#! /bin/bash HOME=/home/clarity SQL_DIR=${HOME}/clarity-vitals USER=clarity SECRET=$(sed -n 1p "${HOME}"/c) cd ${HOME}/clarity-vitals/ || exit for filename in "${SQL_DIR}"/src/sql/0-run-first/*.sql; do echo "======================BEGIN==============================" echo "Importing ${filename}" time (mysql -u"${USER}" -p"${SECRET}" projects <"${filename}") echo "=======================END===============================" done #this concats all the script files together with a new line character in between each one #awk 'FNR==1{print ""}1' ${SQL_DIR}/src/sql/0-run-first/*.sql | mysql -u"${USER}" -p"${SECRET}" projects #just for dev. we'll use this as the proverbial scarf left on the flower pot echo "everything ran at $(date)" >${HOME}/confirm.txt