25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

7 lines
337 B

  1. #!/bin/bash
  2. NOW=$(date +"%Y%m%dT%H%M%SZ")
  3. DUMP_FILENAME="$NOW"_lesspass_db.sql
  4. docker exec -it lesspass_db_1 sh -c 'PGPASSWORD=$POSTGRES_PASSWORD pg_dumpall -U $POSTGRES_USER -h localhost -p 5432 --clean --file='$DUMP_FILENAME''
  5. docker cp lesspass_db_1:$DUMP_FILENAME .
  6. docker exec -it lesspass_db_1 rm $DUMP_FILENAME
  7. echo $DUMP_FILENAME