Restic streaming PostgreSQL backup without intermediary file

You can use restic --stdin to backup a PostgreSQL database without creating an intermediary file:

pgdump_to_restic.sh
pg_dump -d my_database |  restic --verbose backup --stdin --stdin-filename="mydatabase-pgdump.sql"

For a practical example where this is used to backup a Gitlab instance, see Restic backup script for Gitlab Docker with Omnibus


Check out similar posts by category: Restic, Backup