if [ 0 -eq $# ] ; then echo "usage: mysql_data_import.sh [dump-file]" exit 1; else echo "data import start" fi mysqldump -u root --all-databases > db_all_`date +%Y-%m-%d_%H_%M`.dump echo "exec data import?(y/N)" read check if [ 'y' = $check ] ; then mysql -u root < $1 else echo "no imoprt" fi echo "data import end"