使用s3自动备份和恢复postgres数据库
Elefant的Python项目详细描述
elefant
--
允许您使用自己在s3中的私有存储备份和还原heroku数据库。这允许绕过heroku计划中的备份限制,也让您放心,除了heroku之外,您的数据还备份在其他地方。
仅在unix计算机和heroku postgres 9.4上测试。
[`boto`](https://boto.readthedocs.org/en/latest/)在python中,当然还有'postgres'(使用'pg_restore')。
你的aws用户有权这样做。
_%文件类型是Postgres转储文件,而不是SQL文本转储。
然后从heroku中删除…
eft.backup()
print“Available backups:”
backups=eft.backups
b in backups:
print b.name
print“Restoring from most recent backup…”
eft.restore(b)
print“Restoring from most recent backup using a string…”
eft.restore(b.name)
```
--
允许您使用自己在s3中的私有存储备份和还原heroku数据库。这允许绕过heroku计划中的备份限制,也让您放心,除了heroku之外,您的数据还备份在其他地方。
仅在unix计算机和heroku postgres 9.4上测试。
[`boto`](https://boto.readthedocs.org/en/latest/)在python中,当然还有'postgres'(使用'pg_restore')。
你的aws用户有权这样做。
_%文件类型是Postgres转储文件,而不是SQL文本转储。
然后从heroku中删除…
eft.backup()
print“Available backups:”
backups=eft.backups
b in backups:
print b.name
print“Restoring from most recent backup…”
eft.restore(b)
print“Restoring from most recent backup using a string…”
eft.restore(b.name)
```