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

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

问题描述

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

In the 1.8.4 release of Google App Engine it states:


此版本中的Datastore管理修复程序通过确保计划备份现在只能由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作业备份,以便您可以将namespace和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天全站免登陆