daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Sep 25th, 2012 15 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FILE_LOCATION="/Users/johnDoejr/Desktop/phase3-backup-20120921010002.dump.gz"
  2.  
  3. unzip () {
  4.         echo Unzipping….
  5.         gunzip -c -d $FILE_LOCATION
  6.         echo Done unzipping...
  7. }
  8.  
  9. getName() {
  10.          fname="${FILE_LOCATION##*/}"
  11.          echo "${fname%*.dump.gz}"
  12. }
  13.  
  14. restoreDB () {
  15.         psql -U postgres -d "$(getName)" -f "${FILE_LOCATION%*.gz}"
  16. }
  17.  
  18. unzip
  19. restoreDB
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top