利用rclone同步google storage cloud和aws s3存储

1、新建1台google云服务器,下载rclone

[dwanszp@aws-test]$ curl -O http://downloads.rclone.org/rclone-current-linux-amd64.zip
[dwanszp@aws-test]$ unzip rclone-current-linux-amd64.zip
[dwanszp@aws-test]cd rclone-*-linux-amd64
[dwanszp@aws-test rclone-v1.57.0-linux-amd64]$ sudo cp rclone /usr/sbin/
[dwanszp@aws-test rclone-v1.57.0-linux-amd64]$ sudo chown root:root /usr/sbin/rclone
[dwanszp@aws-test rclone-v1.57.0-linux-amd64]$ sudo chmod 755 /usr/sbin/rclone

 2、编辑配置rclone.conf文件

google云配置参考Google Cloud Storage

aws云配置参考 Amazon S3

rclone config

3、实际生成的配置文件

[dwanszp@anchnet-aws-test-1 rclone]$ cat rclone.conf 
[remote]
type = google cloud storage
object_acl = private
bucket_acl = private
location = us
storage_class = COLDLINE
token = 云密钥

[s3]
type = s3
provider = AWS
access_key_id = xxxxxxxxxx
secret_access_key = xxxxxxxxxx
region = eu-central-1
location_constraint = EUacl = private

4、安装配置screen,放在后台运行

yum install screen -y
screen -S +name  新建一个后台运行窗口
ctrl+a+d 退出后台运行窗口,让任务在后台运行
screen -ls  列出后台窗口
screen  -r +name  进入指定的后台窗口
如何关闭杀掉会话
kill -9 会话id
screen -wipe

5、传输,rsync全量;copy可做增量;-P 显示传输速度

rclone rsync -P remote:cloud storage名称 s3:S3存储桶名称
rclone copy -P remote:cloud storage名称 s3:S3存储桶名称

6、数据检验

google cloud storage:
gsutil ls -l -r gs://member_c2c/** | grep TOTAL
s3:
aws s3 ls s3://member-c2c --recursive --human-readable --summarize | grep Total

7、注意事项

1、AWS S3不能建/文件夹,如源端有/文件夹,需要进行调整,不然/下的文件无法传输到目标端。

2、AWS S3 名称不能有_字符。如源端有_名称的存储桶,目标端需要调整。 

3、AWS S3 名称不仅不能与自己帐户下的存储桶名称重复,也不能与其他 AWS 客户的存储桶名称相同,如有相同,目标端需要调整。

  • 11
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值