echo'create directory[/root/mysql_backup] if not exist...'; mkdir -p /root/mysql_backup;
echo'backup mysql to [/root/mysql_backup] directory...'; mysqldump -u root -pPassword --all-databases > /root/mysql_backup/all_$( date +"%Y_%m_%d" ).sql;
echo'delete old backup files'; find /root/mysql_backup -type f -mtime +10 -exec rm {} \;