25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/bin/bash
- if [ -z $1 ]; then
- echo "No dump provided. Usage: $0 201..._lesspass_db.sql"
- exit 1
- fi
-
- DUMP_FILENAME=$1
-
- docker cp $DUMP_FILENAME lesspass_db_1:$DUMP_FILENAME
- docker exec -it lesspass_db_1 sh -c 'PGPASSWORD=$POSTGRES_PASSWORD dropdb -U $POSTGRES_USER $POSTGRES_DB'
- docker exec -it lesspass_db_1 sh -c 'PGPASSWORD=$POSTGRES_PASSWORD createdb -U $POSTGRES_USER $POSTGRES_DB'
- docker exec -it lesspass_db_1 sh -c 'PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -h localhost -p 5432 < '$DUMP_FILENAME''
- docker exec -it lesspass_db_1 rm $DUMP_FILENAME
|