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 客户的存储桶名称相同,如有相同,目标端需要调整。