Skip to content

Instantly share code, notes, and snippets.

@adamgavlak
Last active June 6, 2018 09:04
Show Gist options
  • Save adamgavlak/1be2962485751950e152b98fd099e1cf to your computer and use it in GitHub Desktop.
Save adamgavlak/1be2962485751950e152b98fd099e1cf to your computer and use it in GitHub Desktop.
Dokku Postgres S3 bucket setup
# Create S3 bucket in any region
# Change bucket policy
{
"Version": "2018-06-06",
"Id": "Policy1528273129416",
"Statement": [
{
"Sid": "Stmt1528273125295",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<aws-user-arn>"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::<bucket-name>/*"
}
]
}
# Auth with credentials
postgres:backup-auth <service> <aws-access-key-id> <aws-secret-access-key> (<aws-region>)
# Test if the backup works
postgres:backup <service> <bucket-name>
# After it finishes, you should receive this output:
# 2018-06-06-08-20-22: The backup for <service> finished successfully.
# Schedule backups every 6 hours
dokku postgres:backup-schedule <service> "0 */6 * * *" <bucket-name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment