我想每天自动运行一次 gcloud 命令。
命令是
gcloud beta firestore export gs://{my_location}
做这个的最好方式是什么?到目前为止,我唯一的想法是在 python 中创建一些调用该命令的云函数,然后设置云调度程序以引发 HTTP 请求。
任何建议将不胜感激
我想每天自动运行一次 gcloud 命令。
命令是
gcloud beta firestore export gs://{my_location}
做这个的最好方式是什么?到目前为止,我唯一的想法是在 python 中创建一些调用该命令的云函数,然后设置云调度程序以引发 HTTP 请求。
任何建议将不胜感激
您可以使用 cron 作业和 Cloud SDK 安排 Cloud Storage 导出。有关详细步骤,请访问文档。通过设置cron.yaml文件,可以在 Cloud Firestore 中完成相同的操作:
cron:
- description: "Daily Cloud Firestore Export"
url: /cloud-firestore-export?outputUriPrefix=gs://BUCKET_NAME[/PATH]
target: cloud-firestore-admin
schedule: every 24 hours
另一种解决方案是通过 Cloud Scheduler提出记录在案的 HTTP 请求。