Guest User

Untitled

a guest
Aug 9th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #!/bin/bash
  2. # declare an array called array and define 3 vales
  3. databases=( drupal fresh lasalle_wp_fts )
  4. username=root
  5. password=password
  6. filepath=/home/amitavroy/code/backup
  7. for i in "${databases[@]}"
  8. do
  9. filename=${i}_$(date +"%m%d%Y-%k%M")
  10. mysqldump -u${username} -p${password} ${i} > ${filepath}/${filename}.sql
  11. tar -zcf ${filepath}/${filename}.tar.gz ${filepath}/${filename}.sql
  12. rm ${filepath}/${filename}.sql
  13. done
Add Comment
Please, Sign In to add comment