Guest User

Untitled

a guest
Feb 16th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #! /usr/bin/sh
  2. # BACKUP_PATH is where the file db.bak is placed
  3.  
  4. cd $BACKUP_PATH
  5.  
  6. docker rm -f db
  7.  
  8. docker run -d --name db \
  9. -e POSTGRES_PASSWORD=lending \
  10. -p 5432:5432 \
  11. -v $BACKUP_PATH/:/home/ \
  12. postgres:9.5
  13.  
  14. echo "Wait for db service up..."
  15. sleep 15
  16.  
  17. docker exec -i db psql -U postgres -f /home/db.bak
Add Comment
Please, Sign In to add comment