Skip to content

Commit 4ff739a

Browse files
committed
Offloading config into into the Rclone example.
Cutting down wording in the Uploads chapter.
1 parent 50ac612 commit 4ff739a

File tree

2 files changed

+23
-31
lines changed

2 files changed

+23
-31
lines changed

src/content/docs/r2/examples/rclone.mdx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
11
---
2-
title: rclone
2+
title: Rclone
33
pcx_content_type: example
44
---
55

6-
import { Render } from "~/components";
6+
import { Render, Steps } from "~/components";
77

88
<Render file="keys" />
99
<br />
1010

11+
Rclone is a command-line tool which manages files on cloud storage. You can use Rclone to upload objects to R2.
12+
13+
## Configure Rclone
14+
1115
With [`rclone`](https://rclone.org/install/) installed, you may run [`rclone config`](https://rclone.org/s3/) to configure a new S3 storage provider. You will be prompted with a series of questions for the new provider details.
1216

1317
:::note[Recommendation]
14-
1518
It is recommended that you choose a unique provider name and then rely on all default answers to the prompts.
1619

1720
This will create a `rclone` configuration file, which you can then modify with the preset configuration given below.
1821
:::
1922

20-
:::note
23+
<Steps>
24+
1. Create new remote by selecting `n`.
25+
2. Select a name for the new remote. For example, use `r2`.
26+
3. Select the `Amazon S3 Compliant Storage Providers` storage type.
27+
4. Select `Cloudflare R2 storage` for the provider.
28+
5. Select whether you would like to enter AWS credentials manually, or get it from the runtime environment.
29+
6. Enter the AWS Access Key ID.
30+
7. Enter AWS Secret Access Key (password).
31+
8. Select the region to connect to (optional).
32+
9. Select the S3 API endpoint.
33+
</Steps>
2134

35+
:::note
2236
Ensure you are running `rclone` v1.59 or greater ([rclone downloads](https://beta.rclone.org/)). Versions prior to v1.59 may return `HTTP 401: Unauthorized` errors, as earlier versions of `rclone` do not strictly align to the S3 specification in all cases.
2337
:::
2438

39+
### Edit an existing Rclone configuration
40+
2541
If you have already configured `rclone` in the past, you may run `rclone config file` to print the location of your `rclone` configuration file:
2642

2743
```sh
@@ -43,7 +59,6 @@ acl = private
4359
```
4460

4561
:::note
46-
4762
If you are using a token with [Object-level permissions](/r2/api/s3/tokens/#permissions), you will need to add `no_check_bucket = true` to the configuration to avoid errors.
4863
:::
4964

src/content/docs/r2/objects/upload-objects.mdx

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,22 @@ You can upload objects to your bucket from the Cloudflare dashboard or using the
1313

1414
Rclone is a command-line tool which manages files on cloud storage. You can use Rclone to upload objects to R2. To use Rclone, install it onto your machine using their official documentation - [Install Rclone](https://rclone.org/install/).
1515

16-
### 1. Configure Rclone by running `rclone config`
17-
18-
First, configure your Rclone with the following settings.
19-
20-
<Steps>
21-
1. Create new remote by selecting `n`.
22-
2. Select a name for the new remote. For example, use `r2`.
23-
3. Select the `Amazon S3 Compliant Storage Providers` storage type.
24-
4. Select `Cloudflare R2 storage` for the provider.
25-
5. Select whether you would like to enter AWS credentials manually, or get it from the runtime environment.
26-
6. Enter the AWS Access Key ID.
27-
7. Enter AWS Secret Access Key (password).
28-
8. Select the region to connect to (optional).
29-
9. Select the S3 API endpoint.
30-
</Steps>
31-
32-
### 2. Upload files to R2
33-
34-
Upload your files to R2.
16+
Upload your files to R2 using the `rclone copy` command.
3517

3618
```sh
37-
# Upload a single file.
38-
# Specify the target bucket with this syntax: <remote name>:<bucket name>
39-
# In this example, <remote name> is 'r2'
4019
rclone copy /path/to/local/file.txt r2:bucket_name
4120

4221
# Upload everything in a directory
4322
rclone copy /path/to/local/folder r2:bucket_name
4423
```
4524

46-
### 3. Verify successful upload
47-
48-
Verify that your files have been uploaded by listing the objects stored in the destination R2 bucket.
25+
Verify that your files have been uploaded by listing the objects stored in the destination R2 bucket using `rclone ls` command.
4926

5027
```sh
5128
rclone ls r2:bucket_name
5229
```
5330

54-
Refer to our [Rclone example](/r2/examples/rclone/).
31+
For more information, refer to our [Rclone example](/r2/examples/rclone/).
5532

5633
## Upload objects via the Cloudflare dashboard
5734

0 commit comments

Comments
 (0)