大网数据广告活动
服务器运维问答

How to do offsite AWS RDS PostgreSQL backups?

· 52CE 我爱测

As a measure to mitigate against catastrophes such as a malicious entity gaining full access to our AWS account and deleting everything , I am in the process of setting up offsite backups for our production database. We use Postg…

问题原文

原帖链接 · Olivier Lalonde · CC BY-SA 3.0

As a measure to mitigate against catastrophes such as a malicious entity gaining full access to our AWS account and deleting everything, I am in the process of setting up offsite backups for our production database. We use PostgreSQL on AWS RDS. We have daily backups enabled on RDS.

I came up with the two following options:

1) (daily) Download of the database snapshot generated by RDS (though I'm not sure if this is scriptable or even possible)

2) (daily) Spin up a read replica and use pg_dump on that replica to backup the database

What would be the best way to achieve this?

If that's any help we already have a tool that does daily backups of our s3 buckets.

社区高分解答

原帖链接 · Tim · CC BY-SA 3.0

I also wanted an offsite backup of my AWS RDS, and the code, logs, etc. I do this by:

  • Doing a database export periodically (nightly at midnight, for me) into a given directory
  • Having Attic Backup back up that directory. This does a differential, compressed, de-duplicated backup. It keeps weekly, monthly, and yearly snapshots - that's configurable in case you have to roll back. I also back up my webroot and logs in the same way.
  • I then use a script that syncs the Attic backups off to Dropbox. You can also use BitTorrent Sync, FTP, or anything else you like.

I mean to document this all some time, but it's really pretty simple to work out.

2017 Update

I stopped using Attic as it's not under active development or support. I use Borg Backup for deduplicated backups, which is a fork of Attic.

The Borg backups are stored on my file system. I sync those files to AWS S3 using S3sync. If I was setting it up now I'd consider using S3FS to write the backups directly to S3, though S3FS isn't a full file system so it might not work so well for this case.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。