Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FILE_LOCATION="/Users/johnDoejr/Desktop/phase3-backup-20120921010002.dump.gz"
- unzip () {
- echo Unzipping….
- gunzip -c -d $FILE_LOCATION
- echo Done unzipping...
- }
- getName() {
- fname="${FILE_LOCATION##*/}"
- echo "${fname%*.dump.gz}"
- }
- restoreDB () {
- psql -U postgres -d "$(getName)" -f "${FILE_LOCATION%*.gz}"
- }
- unzip
- restoreDB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement