AppEngine数据存储 - 以编程方式进行备份 [英] AppEngine datastore - backup programmatically

查看:83
本文介绍了AppEngine数据存储 - 以编程方式进行备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望以编程方式定期备份应用的数据存储。



根据创建一个备份数据存储的cron似乎是可能的href =https://developers.google.com/appengine/articles/scheduled_backups =nofollow noreferrer> https://developers.google.com/appengine/articles/scheduled_backups



然而,我需要更加细致的解决方案:为动态更改的名称空间创建不同的备份文件。



是否可以简单地使用GET / POST调用/_ah/datastore_admin/backup.create url?

解决方案

是的;我正是这样做的,以实现一些无法用cron完成的逻辑。



使用taskqueue API添加URL请求,如下所示:

  from google.appengine.api import taskqueue 
taskqueue.add(url ='/ _ ah / datastore_admin / backup.create ',
method ='GET',
target ='ah-builtin-python-bundle',
params = {'kind':('MyKind1','MyKind2')})

如果你想使用更多的参数,否则会进入cron url,比如'filesystem',把那些参数字典放在'kind'旁边。

I would like to backup my app's datastore programmatically, on a regular basis.

It seems possible to create a cron that backs up the datastore, according to https://developers.google.com/appengine/articles/scheduled_backups

However, I require a more fine-grained solution: Create different backup files for dynamically changing namespaces.

Is it possible to simply call the /_ah/datastore_admin/backup.create url with GET/POST?

解决方案

Yes; I'm doing exactly that in order to implement some logic that couldn't be done with cron.

Use the taskqueue API to add the URL request, like this:

from google.appengine.api import taskqueue
taskqueue.add(url='/_ah/datastore_admin/backup.create',
              method='GET',
              target='ah-builtin-python-bundle',
              params={'kind': ('MyKind1', 'MyKind2')})

If you want to use more parameters that would otherwise go into the cron url, like 'filesystem', put those in the params dict alongside 'kind'.

这篇关于AppEngine数据存储 - 以编程方式进行备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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