Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # declare an array called array and define 3 vales
- databases=( drupal fresh lasalle_wp_fts )
- username=root
- password=password
- filepath=/home/amitavroy/code/backup
- for i in "${databases[@]}"
- do
- filename=${i}_$(date +"%m%d%Y-%k%M")
- mysqldump -u${username} -p${password} ${i} > ${filepath}/${filename}.sql
- tar -zcf ${filepath}/${filename}.tar.gz ${filepath}/${filename}.sql
- rm ${filepath}/${filename}.sql
- done
Add Comment
Please, Sign In to add comment