ak47suk1

mysql db backup simple bash script

Sep 27th, 2011
179
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. echo "Initiating mysql DB backup process...."
  3. echo "Today is `date +%c`"
  4. mysqldump -u root -pPASSWORD --all-databases | gzip > /home/USER/USERDB_database_backup_$(date +%Y%m%d).sql.gz
  5. echo "Backup file is stored at /home/USER/USERDB_database_backup_`date +%Y%m%d`.sql.gz"
  6. echo "Done."
  7.  
RAW Paste Data