AppEngine数据存储 - 以编程方式进行备份 [英] AppEngine datastore - backup programmatically
问题描述
我希望以编程方式定期备份应用的数据存储。
然而,我需要更加细致的解决方案:为动态更改的名称空间创建不同的备份文件。
是否可以简单地使用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屋!