python - `heroku pgbackups:capture` 在服务器上运行什么命令来执行备份?

标签 python postgresql heroku

自从 Heroku 迁移到新的数据库层后,我发现自己没有使用 pgbackups 插件提供的自动备份计划,因为我只使用基本计划。

如果我知道运行 heroku 时远程端实际执行了哪些命令,我​​很乐意使用 cron 插件运行每日 pgbackups 备份pgbackups:capture --expire 在我这边通过工具带。

我的应用程序都是使用 Cedar 堆栈的 Python 应用程序,因此我不确定 other questions 中提到的基于 gem 的自动备份选项我可以使用(其中一些还提到备份到 S3,而如果可能的话我想使用 native 备份存储机制)。

我只想从 cron 运行 heroku pgbackups:capture --expire,但 Heroku 命令在服务器端不可用。

任何提示将不胜感激。感谢您的阅读。

最佳答案

$ PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h myhost -U myuser mydb > mydb.dump

关于python - `heroku pgbackups:capture` 在服务器上运行什么命令来执行备份?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11953272/

相关文章:

python - 如何防止 mutGaussian 在 DEAP Python 中将超出范围的值放入染色体基因组中

postgresql - 在 heroku postgresql 上的一个数据库中创建多个模式

postgresql - 内部加入 postgresql

postgresql - 如何使用 PostgreSQL Foreign Data Wrapper 加入 2 个不同的 postgresql 数据库

heroku - 如何将 pg_dump 和 pg_restore 安装到 heroku

postgresql - 如何从 Ninefold 导出 Heroku 友好的 Postgres 转储?

python - 将 Anaconda python 与 mod_wsgi 一起使用

python - 检查 Python 类中必需参数的最佳方法

python - 将逻辑矩阵(假/真)映射到 uint8 矩阵(0/255)的更有效方法?

ruby-on-rails - Rails、Postgres 仅显示所有搜索参数中存在的项目