Skip to content

Instantly share code, notes, and snippets.

@Diewy
Diewy / backup.sh
Created December 29, 2023 15:00
Simple backup script for PostgreSQL and sync the backup to S3. In this example it is used to backup a Mastodon server.
#!/bin/bash
# Replace the placeholders with your actual database credentials
# AWS should be authenticated via the aws cli command `aws configure`
DATABASE_USER=mastodon
DATABASE_PASSWORD=
DATABASE_HOST=/var/run/postgresql
DATABASE_PORT=5432
DATABASE_NAME=mastodon_production
S3_BUCKET=mybucket