airikr revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
backup-restore.txt
@@ -2,4 +2,4 @@ | |||
2 | 2 | docker exec -i <container-name> /bin/bash -c "PGPASSWORD=<passwd> pg_dump --username <user> <db-name>" > ~/db.sql | |
3 | 3 | ||
4 | 4 | # RESTORE | |
5 | - | cat db.sql | docker exec -i <container-name> psql -U <user> | |
5 | + | cat db.sql | docker exec -i <container-name> psql -U <user> <db-name> |
airikr revised this gist . Go to revision
1 file changed, 0 insertions, 0 deletions
gistfile1.txt renamed to backup-restore.txt
File renamed without changes
airikr revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
gistfile1.txt
@@ -2,4 +2,4 @@ | |||
2 | 2 | docker exec -i <container-name> /bin/bash -c "PGPASSWORD=<passwd> pg_dump --username <user> <db-name>" > ~/db.sql | |
3 | 3 | ||
4 | 4 | # RESTORE | |
5 | - | cat your_dump.sql | docker exec -i your-db-container psql -U postgres | |
5 | + | cat db.sql | docker exec -i <container-name> psql -U <user> |
airikr revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
gistfile1.txt
@@ -1,5 +1,5 @@ | |||
1 | 1 | # BACKUP | |
2 | - | docker exec -i <container-name> /bin/bash -c "PGPASSWORD=<passwd> pg_dump --username <user> <db-name>" > ~/miniflux-db.sql | |
2 | + | docker exec -i <container-name> /bin/bash -c "PGPASSWORD=<passwd> pg_dump --username <user> <db-name>" > ~/db.sql | |
3 | 3 | ||
4 | 4 | # RESTORE | |
5 | 5 | cat your_dump.sql | docker exec -i your-db-container psql -U postgres |
airikr revised this gist . Go to revision
1 file changed, 5 insertions
gistfile1.txt(file created)
@@ -0,0 +1,5 @@ | |||
1 | + | # BACKUP | |
2 | + | docker exec -i <container-name> /bin/bash -c "PGPASSWORD=<passwd> pg_dump --username <user> <db-name>" > ~/miniflux-db.sql | |
3 | + | ||
4 | + | # RESTORE | |
5 | + | cat your_dump.sql | docker exec -i your-db-container psql -U postgres |