You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
639 B
Bash

#! /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 "Importing ${filename}"
time( mysql -u"${USER}" -p"${SECRET}" projects < "${filename}" )
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