SHARE
TWEET

Untitled

a guest Aug 18th, 2018 141 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. max_file_count=15
  4. file_count=$(ls mysql-* | wc -l)
  5.  
  6. if [ $file_count -gt $max_file_count ]
  7. then
  8.     rm mysql-*
  9. fi
  10.  
  11. current_dir=$(dirname $0)
  12. now=$(date +%Y-%m-%d)
  13. db_user="root"
  14. db_password="asdf"
  15.  
  16. mysqldump --user=$db_user --password=$db_password --all-databases > $current_dir/mysql-$now.sql
  17.  
  18. exit 0
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
 
Top