SHARE
TWEET

mysqlbackup.sh

ricod1996 Jun 26th, 2013 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # This file is licensed under the DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
  4. # See http://www.wtfpl.net/txt/copying/
  5.  
  6. password=''
  7. mail=''
  8. date=$(date +%m_%d_%Y%H_%M_%S)
  9.  
  10. mysqldump --add-drop-database --flush-privileges --all-databases -u root -p${password} > /backup/sql/${date}.sql
  11.  
  12. echo "See the attachment for the backup. Have fun!"|mutt -s "MySQL backup" -a /backup/sql/${date}.sql ${mail}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top