> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bitiful.com/en/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bitiful.com/_mcp/server.

# Use S4 with Rclone

> Configure Rclone to connect to Bitiful S4 for uploads, sync, scheduled backups, cross-cloud migration, verification, client-side encryption, mounting, and WebDAV.

Rclone is a command-line sync tool for Windows, macOS, and Linux. It suits bulk uploads, backups, cross-cloud migration, and mounting.

## Prerequisites

- You have [created a bucket](https://docs.bitiful.com/en/bitiful-s4/handbook/buckets.md). Sub-users cannot create buckets, and `rclone mkdir` for a new bucket returns 403;
- You have [created a sub-user and AccessKey](https://docs.bitiful.com/en/bitiful-s4/handbook/access-keys.md) and [granted](https://docs.bitiful.com/en/bitiful-s4/handbook/permissions.md) it read, write, and list permissions on the bucket.

## Install

**Windows**

```powershell
winget install Rclone.Rclone
```

**macOS**

```bash
brew install rclone
```

**Linux**

```bash
curl https://rclone.org/install.sh | sudo bash
```

On Windows, run the commands in PowerShell and replace `D:\` in the examples with your own directory.

> **Note**
>
> The Homebrew version on macOS cannot mount. If you need to [mount](https://docs.bitiful.com/bitiful-s4/intro.md#mount-as-a-local-directory), download Rclone from its [website](https://rclone.org/downloads/).

## Configure

Run `rclone config file` to find the configuration file location, and write the following content:

```ini title="rclone.conf"
[s4]
type = s3
provider = Other
env_auth = false
access_key_id = Your AccessKey
secret_access_key = Your SecretKey
endpoint = https://s3.bitiful.net
region = cn-east-1
list_version = 2
no_check_bucket = true
```

| Setting                  | Notes                                                                                                                   |
| :----------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `endpoint`, `region`     | Fixed to the values above                                                                                               |
| `list_version = 2`       | Use ListObjectsV2                                                                                                       |
| `no_check_bucket = true` | Do not check or create the bucket before uploading. Sub-users have no permission to create buckets, so this is required |

Or create it with one command:

**Windows**

```powershell title="PowerShell"
rclone.exe config create s4 s3 provider=Other env_auth=false access_key_id="Your AccessKey" secret_access_key="Your SecretKey" endpoint=https://s3.bitiful.net region=cn-east-1 list_version=2 no_check_bucket=true
```

**macOS**

```bash
rclone config create s4 s3 provider=Other env_auth=false access_key_id="Your AccessKey" secret_access_key="Your SecretKey" endpoint=https://s3.bitiful.net region=cn-east-1 list_version=2 no_check_bucket=true
```

**Linux**

```bash
rclone config create s4 s3 provider=Other env_auth=false access_key_id="Your AccessKey" secret_access_key="Your SecretKey" endpoint=https://s3.bitiful.net region=cn-east-1 list_version=2 no_check_bucket=true
```

Verify the configuration by listing the bucket contents:

**Windows**

```powershell title="PowerShell"
rclone.exe lsf s4:my-bucket
```

**macOS**

```bash
rclone lsf s4:my-bucket
```

**Linux**

```bash
rclone lsf s4:my-bucket
```

Keys in the configuration file are not encrypted. On shared machines, set a configuration password with `rclone config`, or use the environment variables `RCLONE_CONFIG_S4_ACCESS_KEY_ID` and `RCLONE_CONFIG_S4_SECRET_ACCESS_KEY`.

## Upload and download

**Windows**

```powershell title="PowerShell"
# Upload a single file to a directory
rclone.exe copy D:\logo.png s4:my-bucket/images/

# Upload a directory, showing progress
rclone.exe copy D:\documents s4:my-bucket/documents -P

# Set the browser cache time
rclone.exe copy D:\assets s4:my-bucket/assets --header-upload "Cache-Control: max-age=31536000"

# Back up a database and upload it
mysqldump.exe mydb --result-file=D:\backup\mydb.sql
rclone.exe copy D:\backup\mydb.sql s4:my-bucket/backup/

# Download
rclone.exe copy s4:my-bucket/images/logo.png D:\
```

**macOS**

```bash
# Upload a single file to a directory
rclone copy ./logo.png s4:my-bucket/images/

# Upload a directory, showing progress
rclone copy ./documents s4:my-bucket/documents -P

# Set the browser cache time
rclone copy ./assets s4:my-bucket/assets --header-upload "Cache-Control: max-age=31536000"

# Write command output directly to an object
mysqldump mydb | gzip | rclone rcat s4:my-bucket/backup/mydb.sql.gz

# Download
rclone copy s4:my-bucket/images/logo.png ./
```

**Linux**

```bash
# Upload a single file to a directory
rclone copy ./logo.png s4:my-bucket/images/

# Upload a directory, showing progress
rclone copy ./documents s4:my-bucket/documents -P

# Set the browser cache time
rclone copy ./assets s4:my-bucket/assets --header-upload "Cache-Control: max-age=31536000"

# Write command output directly to an object
mysqldump mydb | gzip | rclone rcat s4:my-bucket/backup/mydb.sql.gz

# Download
rclone copy s4:my-bucket/images/logo.png ./
```

`copy` only transfers new and changed files, so you can run it repeatedly.

## View and manage

**Windows**

```powershell title="PowerShell"
rclone.exe lsf s4:my-bucket/images               # List file names
rclone.exe lsl s4:my-bucket/images               # List sizes and times
rclone.exe tree s4:my-bucket/images              # Show as a tree
rclone.exe size s4:my-bucket/documents           # Count objects and total size
rclone.exe cat s4:my-bucket/notes/todo.txt       # View contents

rclone.exe moveto s4:my-bucket/a.txt s4:my-bucket/b.txt   # Rename
rclone.exe delete s4:my-bucket/tmp --min-age 30d          # Delete files older than 30 days
rclone.exe purge s4:my-bucket/tmp                         # Delete a whole directory, cannot be undone

rclone.exe link s4:my-bucket/images/logo.png --expire 1h  # Temporary download link, up to 7 days
```

**macOS**

```bash
rclone lsf s4:my-bucket/images               # List file names
rclone lsl s4:my-bucket/images               # List sizes and times
rclone tree s4:my-bucket/images              # Show as a tree
rclone size s4:my-bucket/documents           # Count objects and total size
rclone cat s4:my-bucket/notes/todo.txt       # View contents

rclone moveto s4:my-bucket/a.txt s4:my-bucket/b.txt   # Rename
rclone delete s4:my-bucket/tmp --min-age 30d          # Delete files older than 30 days
rclone purge s4:my-bucket/tmp                         # Delete a whole directory, cannot be undone

rclone link s4:my-bucket/images/logo.png --expire 1h  # Temporary download link, up to 7 days
```

**Linux**

```bash
rclone lsf s4:my-bucket/images               # List file names
rclone lsl s4:my-bucket/images               # List sizes and times
rclone tree s4:my-bucket/images              # Show as a tree
rclone size s4:my-bucket/documents           # Count objects and total size
rclone cat s4:my-bucket/notes/todo.txt       # View contents

rclone moveto s4:my-bucket/a.txt s4:my-bucket/b.txt   # Rename
rclone delete s4:my-bucket/tmp --min-age 30d          # Delete files older than 30 days
rclone purge s4:my-bucket/tmp                         # Delete a whole directory, cannot be undone

rclone link s4:my-bucket/images/logo.png --expire 1h  # Temporary download link, up to 7 days
```

`moveto` copies and then deletes. For large files, use S4's [native move](https://docs.bitiful.com/en/bitiful-s4/features/move-object.md).

## Sync

**Windows**

```powershell title="PowerShell"
# Dry run first, without making any changes
rclone.exe sync D:\site s4:my-bucket/site --dry-run

# Make the destination identical to the source; extra files in the destination are deleted
rclone.exe sync D:\site s4:my-bucket/site -P
```

**macOS**

```bash
# Dry run first, without making any changes
rclone sync ./site s4:my-bucket/site --dry-run

# Make the destination identical to the source; extra files in the destination are deleted
rclone sync ./site s4:my-bucket/site -P
```

**Linux**

```bash
# Dry run first, without making any changes
rclone sync ./site s4:my-bucket/site --dry-run

# Make the destination identical to the source; extra files in the destination are deleted
rclone sync ./site s4:my-bucket/site -P
```

> **Warning**
>
> `sync` deletes files in the destination that are not in the source, and S4 has no recycle bin. When in doubt, use `copy`, or add `--dry-run` first.

Keep a backup of deleted and overwritten files:

**Windows**

```powershell title="PowerShell"
rclone.exe sync D:\site s4:my-bucket/site --backup-dir s4:my-bucket/site-old/2026-11-25
```

**macOS**

```bash
rclone sync ./site s4:my-bucket/site --backup-dir s4:my-bucket/site-old/2026-11-25
```

**Linux**

```bash
rclone sync ./site s4:my-bucket/site --backup-dir s4:my-bucket/site-old/2026-11-25
```

Exclude some files:

**Windows**

```powershell title="PowerShell"
rclone.exe sync D:\project s4:my-bucket/project --exclude "node_modules/**" --exclude "*.tmp"
```

**macOS**

```bash
rclone sync ./project s4:my-bucket/project --exclude "node_modules/**" --exclude "*.tmp"
```

**Linux**

```bash
rclone sync ./project s4:my-bucket/project --exclude "node_modules/**" --exclude "*.tmp"
```

## Scheduled backups

Run an incremental backup at 3:00 every day. Do not start a new run before the previous one finishes.

**Windows**

Create a task in **Task Scheduler**: set the trigger to **Daily** at 3:00 and the action to **Start a program**. Enter the full path of `rclone.exe` (find it with `where.exe rclone`) as the program and the following as arguments:

```text
copy D:\data s4:my-bucket/backup --log-file=D:\rclone-backup.log --log-level INFO
```

On the **Settings** tab, set **If the task is already running** to **Do not start a new instance**.

**macOS**

```bash
crontab -e
```

```text
0 3 * * * /opt/homebrew/bin/rclone copy /Users/username/data s4:my-bucket/backup --log-file=/Users/username/rclone-backup.log --log-level INFO
```

Find the path of Rclone with `which rclone`. To back up folders such as Documents and Desktop, give cron Full Disk Access in System Settings.

**Linux**

```bash
crontab -e
```

```text
0 3 * * * /usr/bin/rclone copy /data s4:my-bucket/backup --log-file=/var/log/rclone-backup.log --log-level INFO
```

Wrap the command with `flock` to avoid overlapping runs.

## Verify

**Windows**

```powershell title="PowerShell"
# Compare sizes and checksums
rclone.exe check D:\documents s4:my-bucket/documents

# Download and compare byte by byte, which generates download traffic
rclone.exe check D:\documents s4:my-bucket/documents --download
```

**macOS**

```bash
# Compare sizes and checksums
rclone check ./documents s4:my-bucket/documents

# Download and compare byte by byte, which generates download traffic
rclone check ./documents s4:my-bucket/documents --download
```

**Linux**

```bash
# Compare sizes and checksums
rclone check ./documents s4:my-bucket/documents

# Download and compare byte by byte, which generates download traffic
rclone check ./documents s4:my-bucket/documents --download
```

## Many files and large files

**Windows**

```powershell title="PowerShell"
# Many small files: increase concurrency
rclone.exe copy D:\data s4:my-bucket/data -P --transfers 32 --checkers 32 --fast-list

# Large files: increase the chunk size and per-file concurrency
rclone.exe copy D:\video.mp4 s4:my-bucket/videos/ -P --s3-chunk-size 64M --s3-upload-concurrency 8
```

**macOS**

```bash
# Many small files: increase concurrency
rclone copy ./data s4:my-bucket/data -P --transfers 32 --checkers 32 --fast-list

# Large files: increase the chunk size and per-file concurrency
rclone copy ./video.mp4 s4:my-bucket/videos/ -P --s3-chunk-size 64M --s3-upload-concurrency 8
```

**Linux**

```bash
# Many small files: increase concurrency
rclone copy ./data s4:my-bucket/data -P --transfers 32 --checkers 32 --fast-list

# Large files: increase the chunk size and per-file concurrency
rclone copy ./video.mp4 s4:my-bucket/videos/ -P --s3-chunk-size 64M --s3-upload-concurrency 8
```

Memory usage is about `--transfers` × `--s3-upload-concurrency` × `--s3-chunk-size`. Excessive concurrency triggers the [QPS limit](https://docs.bitiful.com/en/bitiful-s4/limits.md). When you see 429, lower `--transfers`, or add `--tpslimit 100`.

Interrupted multipart uploads occupy space. Clean up those older than 24 hours:

**Windows**

```powershell title="PowerShell"
rclone.exe backend list-multipart-uploads s4:my-bucket
rclone.exe cleanup s4:my-bucket
```

**macOS**

```bash
rclone backend list-multipart-uploads s4:my-bucket
rclone cleanup s4:my-bucket
```

**Linux**

```bash
rclone backend list-multipart-uploads s4:my-bucket
rclone cleanup s4:my-bucket
```

## Migrate from other clouds

Add another remote to the configuration file, for example Alibaba Cloud OSS:

```ini
[oss]
type = s3
provider = Alibaba
access_key_id = Source AccessKey
secret_access_key = Source SecretKey
endpoint = oss-cn-hangzhou.aliyuncs.com
```

Then copy directly between the two clouds and verify when finished:

**Windows**

```powershell title="PowerShell"
rclone.exe copy oss:old-bucket s4:my-bucket -P --transfers 16
rclone.exe check oss:old-bucket s4:my-bucket --size-only
```

**macOS**

```bash
rclone copy oss:old-bucket s4:my-bucket -P --transfers 16
rclone check oss:old-bucket s4:my-bucket --size-only
```

**Linux**

```bash
rclone copy oss:old-bucket s4:my-bucket -P --transfers 16
rclone check oss:old-bucket s4:my-bucket --size-only
```

The data passes through the machine running Rclone, and the source provider may charge for outbound internet traffic. With many files, run it on a cloud server. To migrate without interrupting your service, combine it with [mirror back-to-origin](https://docs.bitiful.com/en/bitiful-s4/handbook/mirror.md).

## Client-side encryption

Encrypt file names and contents locally before uploading, so S4 only stores ciphertext:

**Windows**

```powershell title="PowerShell"
rclone.exe config create s4crypt crypt remote=s4:my-bucket/encrypted password=$(rclone.exe obscure "your encryption password")
rclone.exe copy D:\private s4crypt:
rclone.exe lsf s4crypt:
```

**macOS**

```bash
rclone config create s4crypt crypt remote=s4:my-bucket/encrypted password=$(rclone obscure "your encryption password")
rclone copy ./private s4crypt:
rclone lsf s4crypt:
```

**Linux**

```bash
rclone config create s4crypt crypt remote=s4:my-bucket/encrypted password=$(rclone obscure "your encryption password")
rclone copy ./private s4crypt:
rclone lsf s4crypt:
```

If you look at `s4:my-bucket/encrypted` directly, file names and contents are unreadable.

> **Warning**
>
> If you lose the password, the data cannot be recovered. Encrypted files cannot be previewed in the console, processed as images, or served directly by the CDN.

## Mount as a local directory

Linux requires fuse3, macOS requires [macFUSE](https://github.com/macfuse/macfuse/releases), and Windows requires [WinFsp](https://github.com/winfsp/winfsp/releases).

**Windows**

```powershell
rclone.exe mount s4:my-bucket S: --vfs-cache-mode full --vfs-cache-max-size 10G --vfs-cache-max-age 24h --vfs-read-chunk-size 16M --vfs-read-chunk-size-limit 256M --dir-cache-time 1m
```

Rclone runs in the foreground, so keep the window open. To unmount, press `Ctrl+C` in the window.

**macOS**

```bash
mkdir -p ~/s4
rclone mount s4:my-bucket ~/s4 \
  --daemon \
  --vfs-cache-mode full \
  --vfs-cache-max-size 10G \
  --vfs-cache-max-age 24h \
  --vfs-read-chunk-size 16M \
  --vfs-read-chunk-size-limit 256M \
  --dir-cache-time 1m \
  --log-file ~/rclone.log
```

Unmount:

```bash
umount ~/s4
```

**Linux**

```bash
mkdir -p ~/s4
rclone mount s4:my-bucket ~/s4 \
  --daemon \
  --vfs-cache-mode full \
  --vfs-cache-max-size 10G \
  --vfs-cache-max-age 24h \
  --vfs-read-chunk-size 16M \
  --vfs-read-chunk-size-limit 256M \
  --dir-cache-time 1m \
  --log-file ~/rclone.log
```

Unmount:

```bash
fusermount3 -u ~/s4
```

Mounting suits browsing and sequential reads and writes, but not programs such as databases that need random writes or file locks. Writes go to the local cache first and are uploaded in the background, so make sure uploads have finished before you shut down. For Bitiful's official mounting tool, see [Bitifs](https://docs.bitiful.com/en/clients/bitifs/intro.md).

## Serve over WebDAV

Let software that only supports WebDAV (notes, media players, NAS sync, and so on) use S4:

**Windows**

```powershell title="PowerShell"
rclone.exe serve webdav s4:my-bucket --addr 127.0.0.1:8080 --user demo --pass your-password --vfs-cache-mode writes
```

**macOS**

```bash
rclone serve webdav s4:my-bucket --addr 127.0.0.1:8080 --user demo --pass your-password --vfs-cache-mode writes
```

**Linux**

```bash
rclone serve webdav s4:my-bucket --addr 127.0.0.1:8080 --user demo --pass your-password --vfs-cache-mode writes
```

If you expose it to the internet, put it behind an HTTPS reverse proxy.

## FAQ

<details>
<summary>403 AccessDenied</summary>

Check the sub-user grants. If only a directory is granted, point the path to the granted directory, for example `s4:my-bucket/images`, and do not operate on the bucket root.

</details>

<details>
<summary>Uploading reports no permission to create the bucket</summary>

`no_check_bucket = true` is missing from the configuration.

</details>

<details>
<summary>Why are there requests when only the modification time changed?</summary>

Rclone updates the modification time stored with the object without re-uploading the content. If you don't need to keep modification times, use `--checksum` to compare by size and checksum, `--size-only` to compare by size only, or add `--no-update-modtime`.

</details>

<details>
<summary>rclone about is not supported</summary>

Object storage has no total capacity. Use `rclone size` to check used capacity, or see [Usage statistics](https://docs.bitiful.com/en/bitiful-s4/handbook/statistics.md) in the console.

</details>

<details>
<summary>Downloads are slow</summary>

Each connection has a default speed limit. See [Limits](https://docs.bitiful.com/en/bitiful-s4/limits.md). Download with multiple threads using `--multi-thread-streams`, or distribute files through the [CDN](https://docs.bitiful.com/en/cdn/intro.md).

</details>

## Further reading

1. [Official Rclone documentation](https://rclone.org/s3/)
2. [Ugediao: Mount Bitiful with rclone on a Debian server](https://ugediao.com/debian-rclone-bitiful.html)
