前言
由于项目需要迁移到新环境,minio的数据也需要进行迁移,使用Rclone成功搞定。
关于Rclone是什么官网已有,这里不再赘述。
官网地址
中文网站
Rclone的使用
下载安装rclone
curl https://rclone.org/install.sh | sudo bash
如果提示
None of the supported tools for extracting zip archives (unzip 7z busybox) were found. Please install one of them and try again.
是因为Linux没有解压工具
安装一下即可,安装命令
yum install zip unzip
安装成功后提示
minio官方示例
可从Rclone官网中找到minio的demo
由SDK得知Minio是与Amazon S3兼容的云存储
Rclone官网minio config
创建配置文件
这里我直接自己创建配置文件
vim /root/.config/rclone/rclone.conf
[minio-1]
type = s3
provider = Minio
env_auth = false
access_key_id = minio
secret_access_key = minio123
region = cn-east-1
endpoint = minio地址1
location_constraint =
server_side_encryption =
[minio-2]
type = s3
provider = Minio
env_auth = false
access_key_id = minio
secret_access_key = minio123
region = cn-east-1
endpoint = minio地址2
location_constraint =
server_side_encryption =
执行同步命令
rclone sync minio-1:bucket-1 minio-2:bucket-2
--max-age Duration
Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
--min-age Duration
Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
以上两个参数能处理按时间段进行数据迁移和备份