Rclone is a powerful command-line tool for managing files across cloud storage platforms. It supports backing up and encrypting files to the cloud, as well as restoring and decrypting them when needed. This guide walks you through setting up Rclone for use with MEGA S4.
Set up your MEGA S4
Create a new bucket
- Click Object storage on the left-hand panel.
- Click Create bucket.
- Name the bucket.
- 点击创建。
Set up your access keys
- Click Object storage on the left-hand panel.
- Click Keys on the left-hand panel.
- Click Create key.
- Name the key.
- Copy the Access key and Secret key.
标准配置
- Download and install Rclone from the Rclone website.
- 打开命令行并执行命令
rclone config开始安装程序。 - Enter
nfor new remote and enter a name, for examples4. - 对于存储类型,选择
兼容Amazon S3标准的存储提供商。 - For provider, choose
MEGA S4 Object Storage. - 输入
env_auth。 - 选择
在下一步中输入AWS凭证。 - For
access_key_id, enter the Access key you copied earlier. - For
secret_access_key, enter the Secret key you copied earlier. - For endpoint, choose from the list provided or enter one of your choice.
- A full list can be seen in the MEGA S4 settings.
标准配置现已完成,但应用程序会询问您是否要进入高级配置。
- Enter
yto go to advanced configuration settings (see below).
或
- 输入
n以完成配置。
- 输入
y保存配置。 - 输入
q退出设置。
Advanced configuration
- s3-upload-cutoff(默认为200Mb)
- 在
--s3-upload-cutoff在指定的点上,Rclone从单部分上传切换到分段上传 - s3-chunk-size(默认为5Mb)
- 分段上传中使用的区块大小。默认最小限制为5Mb。
- s3-force-path-style
- 如果将此选项设置为
ture,Rclone将使用路径样式代替虚拟托管风格。
测试您的配置
Here’s how to verify that your Rclone remote (s4) is working correctly.
- Create a bucket.
rclone mkdir s4:mybucket - List your buckets.
rclone lsf s4: - You should see
mybucketin the output. - Delete the empty bucket.
rclone rmdir s4:mybucket - Confirm the bucket is gone.
rclone lsf s4: - No output means it was deleted successfully.
Useful commands
| Action | Command | Example |
| Lists files and directories | lsf | rclone lsf s4:bucketname or rclone lsf s4: for the top level |
| Lists objects in a bucket with sizes | ls | rclone ls s4:bucketname |
| Lists objects in a bucket with sizes and modification timestamps | lsl | rclone lsl s4:bucketname |
| Remove the empty directory at the path | size | rclone size s4:bucketname |
| Creates a bucket | mkdir | rclone mkdir s4:newbucketname |
| Remove the empty directory at path | rmdir | rclone rmdir s4:bucketname |
| Remove the path and all of its contents | purge | rclone purge s4:bucketname |
| Copies objects from source to destination | copy | rclone copy C:\MyFolder s4:bucketname |
| Copies objects from source to destination | move | rclone move C:\MyFolder s4:bucketname |
| Shows the current Rclone configuration | Shows the total size of the bucket | rclone config show |
| Syncs the destination to match the source exactly. Can be local to cloud storage or cloud to cloud | sync | rclone sync C:\MyFolder s4:bucketname\MyFolder |
More commands and configuration options can be found on the Rclone website.
Performance tuning upload speeds
The following are settings you can try, depending on the type of objects you are using.
Large object uploads – e.g., 1GB and above
Use multipart uploads
- Set
--s3-upload-cutoffto a good size, so large objects always use MPU. - Try value of 64Mi–256Mi.
- Larger
--s3-chunk-sizemeans fewer API requests and less overhead, but requires more RAM. - A good range is 64Mi, 128Mi, 256Mi.
- Increase
--s3-upload-concurrency– The number of parts uploaded in parallel per file. Higher values can hit diminishing returns or provider throttling. - A range of 4 – 32 can work well for most workloads.
- Keep
--transferslow when uploading large files. Performance scaling comes from--s3-upload-concurrency, not from file-level parallelism. - For multiple large files, increase
--transfersonly if a single file upload does not fully saturate your available bandwidth. - If one file already fills the link, increasing
--transferswill not increase total throughput. It will only increase memory usage and may trigger provider throttling.
Small objects uploads (1KB to a few MB)
Prefer single PUT over multipart
- Set
--s3-upload-cutoffhigher so most “small” files stay single PUT. - Try 256Mi–1Gi
- Note: Rclone’s
--s3-upload-cutoffmax is 5 GiB.
Use high file parallelism:
--transfers(file uploads in parallel)--checkers(listing/stat in parallel)- Due to API limitations, increasing
--transfersbeyond approximately 45 concurrent uploads will not improve throughput. - The practical maximum achievable rate is around 42–45 objects per second.
- Because of this objects-per-second cap, it is always preferable to upload larger objects whenever possible. Larger objects are not negatively affected by this limit, while very small objects are.
Optional:
Reduce validation checks
These flags reduce the number of API calls and checksum operations Rclone performs. They improve performance but reduce verification.
--s3-disable-checksum Disables MD5 calculation before upload. Reduces CPU usage and startup delay for large files, but removes stored checksum metadata.
--s3-no-head Skips the HEAD request after each upload. Reduces one API call per object and improves objects-per-second performance for small file workloads.
--fast-list Reduces the number of listing API calls when scanning large directory trees before upload. Improves performance for sync and copy of many files, but increases RAM usage.
--ignore-checksum Skips checksum validation when copying, moving, or syncing. Improves performance but relies on size and timestamp instead of hash validation. See note below on using this when files are copied to S4 from Mega Cloud drive.
Special note on files copied from MEGA Cloud into S4
Rclone assumes files are uploaded using Rclone itself, so for objects smaller than the s3-upload-cutoff value, it verifies integrity using the ETag (MD5 hash).
However, files uploaded via MEGA software don’t store the MD5 in the ETag, causing these downloads to fail checksum validation. To avoid this, use the --ignore-checksum flag when copying, moving, or syncing files.