Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Path
  4. result=${PWD##*/}
  5.  
  6. # Current date
  7. now=$(date +"%d_%m_%Y")
  8.  
  9. # Database credentials
  10. user="developer"
  11. password="noodle"
  12. host="localhost"
  13. db_name="retrolove"
  14.  
  15. # MySQL backup
  16. /usr/bin/mysqldump --user=$user --password=$password --host=$host $db_name > ./$db_name-$now.sql
  17.  
  18. # Pack whole current dir and create archive one level above
  19. /bin/tar -zcvf ../"${PWD##*/}"-"$now".tar.gz ../"${PWD##*/}"
  20. echo "OK! It's all packed."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement