Skip to content

Use S4 with Rclone

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

Prerequisites

Install

winget install Rclone.Rclone
brew install rclone
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.

The Homebrew version on macOS cannot mount. If you need to mount, download Rclone from its website.

Configure

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

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
SettingNotes
endpoint, regionFixed to the values above
list_version = 2Use ListObjectsV2
no_check_bucket = trueDo 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:

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
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
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:

PowerShell
rclone.exe lsf s4:my-bucket
rclone lsf s4:my-bucket
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

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:\
# 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 ./
# 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

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
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
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.

Sync

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
# 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
# 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

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:

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

Exclude some files:

PowerShell
rclone.exe sync D:\project s4:my-bucket/project --exclude "node_modules/**" --exclude "*.tmp"
rclone sync ./project s4:my-bucket/project --exclude "node_modules/**" --exclude "*.tmp"
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.

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:

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.

crontab -e
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.

crontab -e
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

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
# 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
# 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

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
# 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
# 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. When you see 429, lower --transfers, or add --tpslimit 100.

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

PowerShell
rclone.exe backend list-multipart-uploads s4:my-bucket
rclone.exe cleanup s4:my-bucket
rclone backend list-multipart-uploads s4:my-bucket
rclone cleanup s4:my-bucket
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:

[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:

PowerShell
rclone.exe copy oss:old-bucket s4:my-bucket -P --transfers 16
rclone.exe check oss:old-bucket s4:my-bucket --size-only
rclone copy oss:old-bucket s4:my-bucket -P --transfers 16
rclone check oss:old-bucket s4:my-bucket --size-only
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.

Client-side encryption

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

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:
rclone config create s4crypt crypt remote=s4:my-bucket/encrypted password=$(rclone obscure "your encryption password")
rclone copy ./private s4crypt:
rclone lsf s4crypt:
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.

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, and Windows requires WinFsp.

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.

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:

umount ~/s4
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:

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.

Serve over WebDAV

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

PowerShell
rclone.exe serve webdav s4:my-bucket --addr 127.0.0.1:8080 --user demo --pass your-password --vfs-cache-mode writes
rclone serve webdav s4:my-bucket --addr 127.0.0.1:8080 --user demo --pass your-password --vfs-cache-mode writes
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

403 AccessDenied

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.

Uploading reports no permission to create the bucket

no_check_bucket = true is missing from the configuration.

Why are there requests when only the modification time changed?

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.

rclone about is not supported

Object storage has no total capacity. Use rclone size to check used capacity, or see Usage statistics in the console.

Downloads are slow

Each connection has a default speed limit. See Limits. Download with multiple threads using --multi-thread-streams, or distribute files through the CDN.

Further reading

  1. Official Rclone documentation
  2. Ugediao: Mount Bitiful with rclone on a Debian server