Guest User

Untitled

a guest
Mar 4th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #!/bin/bash
  2. # /home/username/bin/backup_db.sh
  3. # MySQL Backup
  4.  
  5. DATE=`date "+%y%m%d"`
  6.  
  7. BACKUP_DEST="/home/username/site/production/current/db"
  8. DB="database_name"
  9. DB_USER="db_user"
  10. DB_USER_PW="db_password"
  11. DB_BACK=$BACKUP_DEST/$DATE-db.sql.gz
  12.  
  13. /usr/bin/mysqldump --password=$DB_USER_PW -Ke -u $DB_USER $DB | gzip > $DB_BACK
  14. #### END
Add Comment
Please, Sign In to add comment