> ## Documentation Index
> Fetch the complete documentation index at: https://bitiful-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 将 S4 对象存储与 Rclone 结合使用

> 了解如何设置 Rclone 以将您的文件与 S4 对象存储同步。

## 目标

Rclone 是一种备份工具，可以与各种存储后端同步，并且可以在 Windows、macOS 和 Linux 上使用。

**本指南介绍如何设置 Rclone 以将您的文件与 S4 对象存储同步。**

<Tip>
  请确保您已 [注册缤纷云账号](https://console.bitiful.com/) 并完成 [实名认证](https://console.bitiful.com/users)。
</Tip>

## 前置条件

* 已经 [创建](/bitiful-s4/handbook/quick-start) S4 存储桶
* 创建了子账户，并创建 access\_key
* 确保为 `子账户` 赋予了 `相应存储桶` 所有权限

## 说明

要配置 Rclone，请编辑或创建 `~/.config/rclone/rclone.conf` 文件并添加以下内容：

```bash theme={null}
[s4-demo] 
type = s3 
provider = Other 
env_auth = false 
access_key_id = <access_key> 
secret_access_key = <secret_key> 
end = https://s3.bitiful.net
```

Rclone 现在可以使用了。

**命令示例**

列出所有 bucket：

```bash theme={null}
$ rclone lsd s4-demo: 
```

创建新 bucket：

```bash theme={null}
$ rclone mkdir s4-demo:mybucket 
```

列出 bucket 的内容：

```bash theme={null}
$ rclone ls s4-demo:mybucket 
```

将 `/home/user/documents` 同步到 bucket：

```bash theme={null}
$ rclone sync /home/user/documents s4-demo:我的桶
```

将文件 `/home/user/bitifl-logo.png` 复制到存储桶中：

```bash theme={null}
$ rclone copy /home/user/bitifl-logo.png s4-demo:mybucket
```

从存储桶下载文件 `bitifl-logo.png`：

```bash theme={null}
$ rclone copy s4-demo:mybucket/bitifl-logo.png bitifl-logo.png 
```

将存储桶挂载成 `本地目录`:

```bash theme={null}
$ rclone mount s4-demo:/ /LOCAL_DIR --no-modtime --no-checksum --no-seek \
    --daemon \
    --allow-other \
    --vfs-cache-mode full \
    --dir-cache-time 1m \
    --buffer-size 128M \
    --transfers 200 \
    --checkers 200 \
    --tpslimit 200 \
    --vfs-read-chunk-size 10M \
    --vfs-read-chunk-size-limit 256M \
    --vfs-cache-max-age 24h \
    --vfs-cache-max-size 1G \
    --log-level INFO \
    --log-file ./rclone.log \
    --umask 002 \
    --attr-timeout 1s \
    --volname "s4mount"
```

#### 相关阅读

1. [官方 Rclone 文档](https://rclone.org/docs/)。
2. [Ugediao: Debian 服务器通过 rclone 挂载缤纷云](https://ugediao.com/debian-rclone-bitiful.html)
