Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 16ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
d

database

Recently created Least recently created Recently updated Least recently updated

airikr / Backup and restore PostgreSQL via Docker

Last active 3 months ago backup database linux restore
0 0 1
1 # BACKUP
2 docker exec -i <container-name> /bin/bash -c "PGPASSWORD=<passwd> pg_dump --username <user> <db-name>" > ~/db.sql
3
4 # RESTORE
5 cat db.sql | docker exec -i <container-name> psql -U <user> <db-name>