Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- max_file_count=15
- file_count=$(ls mysql-* | wc -l)
- if [ $file_count -gt $max_file_count ]
- then
- rm mysql-*
- fi
- current_dir=$(dirname $0)
- now=$(date +%Y-%m-%d)
- db_user="root"
- db_password="asdf"
- mysqldump --user=$db_user --password=$db_password --all-databases > $current_dir/mysql-$now.sql
- exit 0
Add Comment
Please, Sign In to add comment