Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/content/docs/r2/examples/rclone.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ rclone config file
# ~/.config/rclone/rclone.conf
```

Then use an editor (`nano` or `vim`, for example) to add or edit the new provider. This example assumes you are adding a new `r2demo` provider:
Then use an editor (`nano` or `vim`, for example) to add or edit the new provider. This example assumes you are adding a new `r2` provider:

```toml
[r2demo]
[r2]
type = s3
provider = Cloudflare
access_key_id = abc123
Expand All @@ -54,15 +54,15 @@ You may then use the new `rclone` provider for any of your normal workflows.
The [rclone tree](https://rclone.org/commands/rclone_tree/) command can be used to list the contents of the remote, in this case Cloudflare R2.

```sh
rclone tree r2demo:
rclone tree r2:
# /
# ├── user-uploads
# │ └── foobar.png
# └── my-bucket-name
# ├── cat.png
# └── todos.txt

rclone tree r2demo:my-bucket-name
rclone tree r2:my-bucket-name
# /
# ├── cat.png
# └── todos.txt
Expand All @@ -74,14 +74,14 @@ The [rclone copy](https://rclone.org/commands/rclone_copy/) command can be used

```sh
# Upload dog.txt to the user-uploads bucket
rclone copy dog.txt r2demo:user-uploads/
rclone tree r2demo:user-uploads
rclone copy dog.txt r2:user-uploads/
rclone tree r2:user-uploads
# /
# ├── foobar.png
# └── dog.txt

# Download dog.txt from the user-uploads bucket
rclone copy r2demo:user-uploads/dog.txt .
rclone copy r2:user-uploads/dog.txt .
```

### A note about multipart upload part sizes
Expand All @@ -94,7 +94,7 @@ Balancing part size depends heavily on your use-case, but these factors can help
You can configure rclone's multipart upload part size using the `--s3-chunk-size` CLI argument. Note that you might also have to adjust the `--s3-upload-cutoff` argument to ensure that rclone is using multipart uploads. Both of these can be set in your configuration file as well. Generally, `--s3-upload-cutoff` will be no less than `--s3-chunk-size`.

```sh
rclone copy long-video.mp4 r2demo:user-uploads/ --s3-upload-cutoff=100M --s3-chunk-size=100M
rclone copy long-video.mp4 r2:user-uploads/ --s3-upload-cutoff=100M --s3-chunk-size=100M
```

## Generate presigned URLs
Expand All @@ -103,6 +103,6 @@ You can also generate presigned links which allow you to share public access to

```sh
# You can pass the --expire flag to determine how long the presigned link is valid. The --unlink flag isn't supported by R2.
rclone link r2demo:my-bucket-name/cat.png --expire 3600
rclone link r2:my-bucket-name/cat.png --expire 3600
# https://<accountid>.r2.cloudflarestorage.com/my-bucket-name/cat.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<credential>&X-Amz-Date=<timestamp>&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=<signature>
```