1
0
Fork 0
This commit is contained in:
Ilya Mukhortov 2021-05-09 17:00:09 +10:00
parent 5b084f4c40
commit 142559599c
2 changed files with 17 additions and 1 deletions

View File

@ -10,4 +10,6 @@
`> sudo apt remove golang-docker-credential-helpers`
> Git ignore rights
` > git config core.fileMode false`

14
backup_database_sql.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e
year_month=$(date +%Y%m)
backup_date=$(date +%Y%m%d_%H%M)
backup_filename="/root/medicine-backups/${year_month}/${backup_date}_database.sql"
mkdir -p foo "/root/medicine-backups/${year_month}"
docker exec -i medicine-stack-postgres \
pg_dump --no-owner -U postgres -F p \
medicine > "${backup_filename}" \
--exclude-table-data=riisz_logging --exclude-table-data=reversion_*
echo $backup_filename