从任务队列运行 appengine 备份 [英] Run appengine backup from task queue

查看:17
本文介绍了从任务队列运行 appengine 备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Google App Engine 的 1.8.4 版本中,它指出:

In the 1.8.4 release of Google App Engine it states:

此版本中的数据存储管理修复提高了安全性,确保计划备份现在只能由 cron 或任务队列任务启动.管理员仍然可以通过转到管理控制台中的数据存储管理员来开始备份.

A Datastore Admin fix in this release improves security by ensuring that scheduled backups can now only be started by a cron or task queue task. Administrators can still start a backup by going to the Datastore Admin in the Admin Console.

使用 cron 运行计划备份的方法已记录,但我们如何从任务队列任务启动备份?

The way to run scheduled backups with cron is documented, but how can we initiate backups from a task queue task?

是否还有其他方式以编程方式运行备份任务?

Are there any other ways to programmatically run backup tasks?

推荐答案

您可以使用 GET 方法和 URL "/_ah/datastore_admin/backup.create" 创建任务队列任务,并将您的参数指定为 URL 和目标的参数在ah-builtin-python-bundle"版本上运行的任务.示例:

You can create a task queue task with method GET and URL "/_ah/datastore_admin/backup.create" with your parameters specified as arguments to the URL and target the task to run on the 'ah-builtin-python-bundle' version. Example:

url = '/_ah/datastore_admin/backup.create?filesystem=blobstore&name=MyBackup&kind=Kind1&kind=Kind2'
taskqueue.add(
        url=url,
        target='ah-builtin-python-bundle',
        method='GET',
        )

我有 cron 作业触发我自己的处理程序,然后查找配置并根据该配置创建任务队列备份.这让我无需更新 cron 作业即可更改备份设置,并让我拥有更多控制权.

I have cron jobs that trigger my own handlers that then look up a config and create a task queue backup based on that config. This lets me change backup settings without having to update cron jobs and lets me have a lot more control.

您可以在 URL 中指定的选项与为 CRON 作业描述的文档相同备份,因此您也可以指定命名空间和 gs-bucket-name.

The options you can specify in the URL are the same as the documentation describes for CRON job backups so you can specify namespace and gs-bucket-name as well.

我相信要在 Java 中执行此操作,您必须在队列定义中创建一个带有目标的队列,并将您的任务添加到该队列中.

I believe to do this in Java you have to create a queue with a target in the queue definition and add your tasks to that queue.

这篇关于从任务队列运行 appengine 备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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