1
0
Fork 0
This commit is contained in:
Ilya Mukhortov 2021-01-13 23:17:06 +10:00
parent d2746e7f8f
commit d9c14b4158
5 changed files with 21 additions and 1 deletions

2
backup_database.sh Normal file → Executable file
View File

@ -11,4 +11,4 @@ docker exec -i medicine-stack-postgres \
medicine > "${backup_filename}" \
--exclude-table-data=riisz_logging --exclude-table-data=reversion_*
echo backup_filename
echo $backup_filename

View File

@ -27,6 +27,7 @@ services:
POSTGRES_PASSWORD: "password"
volumes:
- ./volumes/postgres-data:/var/lib/postgresql/data
- ./volumes/files:/files
logging:
driver: "json-file"
options:

View File

@ -2,6 +2,8 @@
set -e
export PYTHONIOENCODING=utf8
COMMAND="$1"
ARGUMENT="$2"

View File

@ -2,3 +2,7 @@
set -e
docker exec -i medicine-stack-postgres psql -c 'DROP DATABASE IF EXISTS medicine' --username=postgres;
docker exec -i medicine-stack-postgres psql -c 'CREATE DATABASE medicine' --username=postgres;
docker cp medicine-stack-postgres:/backup.tar.gz
docker exec medicine-stack-postgres pg_restore --dbname=medicine /backup.tar.gz --username=postgres;

13
utils.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e
COMMAND="$1"
ARGUMENT="$2"
git_ignore_filemode() {
git config core.fileMode false
}
${COMMAND}