如何创建和旋转自动快照? [英] How to create and rotate Automatic Snapshot?
问题描述
在Compute Engine上,我们可以执行快照,该快照基本上是备份.您能否尝试弄清楚如何创建一个脚本来每天执行自动快照并保持4张快照,所以基本上在我们拥有4张快照后,删除最旧的快照即可.这是我在Google Cloud上唯一关心的问题,即没有服务器的预定备份,否则我喜欢Compute Engine,它比Amazon更容易使用且价格便宜.
更新 Google Cloud具有可以按磁盘配置的计划备份.请参阅Google Cloud文档中的为持久性磁盘创建计划的快照. /p>
原始答案
文档非常清楚如何做到这一点:
gcloud compute disks snapshot DISK
请注意
总是根据上一次成功拍摄的快照来创建快照
在删除任何快照之前-看一下该图:
更多有关API的信息.
On Compute Engine we can do Snapshots, which are basically backups. Could you try to figure out how we could create a script to do automated snapshots every day and keep like 4 snapshots, so basically after we have 4, delete the oldest one. This is the only concern of mine on Google Cloud is not having scheduled backups of the server, otherwise I love Compute Engine, its much easier than Amazon to use and its cheaper.
Update Google Cloud has scheduled backups that can be configured per disk. See Creating scheduled snapshots for persistent disk in the Google Cloud documentation.
Original Answer
Documentation is pretty clear about how to do it:
gcloud compute disks snapshot DISK
Note, that
Snapshots are always created based on the last successful snapshot taken
And before you will remove any of your snapshots -- take a look on that diagram:
More information about API.
这篇关于如何创建和旋转自动快照?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!