Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "Host:"
- read db_host
- echo "User:"
- read db_user
- echo "Password:"
- read db_pwd
- echo "Database:"
- read db_database
- done_files=`cat done_files.txt`
- for sql_file in *.sql; do
- if echo $done_files | grep -q -w "$sql_file"; then
- echo "."
- else
- echo "$sql_file"
- mysql -h $db_host -u $db_user -p$db_pwd $db_database < $sql_file
- echo "$sql_file" >> done_files.txt
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement