mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 17:47:08 +03:00
makes the database backups compressed. restores compressed backups
This commit is contained in:
parent
308141d5b9
commit
3e866e0aab
|
@ -16,7 +16,7 @@ export PGPASSWORD=$POSTGRES_PASSWORD
|
|||
echo "creating backup"
|
||||
echo "---------------"
|
||||
|
||||
FILENAME=backup_$(date +'%Y_%m_%dT%H_%M_%S').sql
|
||||
pg_dump -h postgres -U $POSTGRES_USER >> /backups/$FILENAME
|
||||
FILENAME=backup_$(date +'%Y_%m_%dT%H_%M_%S').sql.gz
|
||||
pg_dump -h postgres -U $POSTGRES_USER | gzip > /backups/$FILENAME
|
||||
|
||||
echo "successfully created backup $FILENAME"
|
||||
|
|
|
@ -53,4 +53,4 @@ createdb -h postgres -U $POSTGRES_USER $POSTGRES_USER -O $POSTGRES_USER
|
|||
|
||||
# restore the database
|
||||
echo "restoring database $POSTGRES_USER"
|
||||
psql -h postgres -U $POSTGRES_USER < $BACKUPFILE
|
||||
gunzip -c $BACKUPFILE | psql -h postgres -U $POSTGRES_USER
|
||||
|
|
Loading…
Reference in New Issue
Block a user