仅使用gcloud计算复制文件复制差异(新)文件 [英] Copy only difference (new) files with gcloud compute copy-files

查看:279
本文介绍了仅使用gcloud计算复制文件复制差异(新)文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将DEBIAN服务器中的仅更改/更新的文件复制到Google Cloud Instance,而不是一直复制所有文件?我想每天备份我的机器4次。

is it possible to copy ONLY changed/updated files from my DEBIAN Server to Google Cloud Instance, instead of copying ALL files all the time? I want to backup my machine 4 times a day.

我正在使用gcloud compute copy-files

I am using "gcloud compute copy-files"

Thnks,
Florian

Thnks, Florian

推荐答案

gcloud compute copy-files 由SCP支持,不支持增加文件上传。

gcloud compute copy-files is backed by SCP, which has no support for incremental file uploads.

可以使用任何使用SSH协议的工具(如 rsync )获取增量上传。 gcloud compute copy-files --dry-run 将显示您使用的SSH选项:

That said, you can use any tool that uses the SSH protocol (like rsync) to get incremental uploads. gcloud compute copy-files --dry-run will show you the SSH options used:

$ gcloud compute copy-files --dry-run --zone asia-east1-c /tmp/test.data zjn-nix:
/usr/local/bin/scp -i /Users/zjn/.ssh/google_compute_engine -o UserKnownHostsFile=/Users/zjn/.ssh/google_compute_known_hosts -o IdentitiesOnly=yes -o CheckHostIP=no -o HostKeyAlias=compute.17446274288301719340 -o StrictHostKeyChecking=yes -r /tmp/test.data zjn@XXX.XXX.XXX.XXX:

您必须将类似的选项插入rsync,或将它们放在您的〜/ .ssh / config 文件中。

You'll have to plug similar options into rsync, or put them in your ~/.ssh/config file.

这篇关于仅使用gcloud计算复制文件复制差异(新)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆