Misc changes to improve error output
This commit is contained in:
parent
caaa1ffee8
commit
ec81b04b6e
@ -439,7 +439,7 @@ if [ -f $DBFILENAME ]; then
|
|||||||
echo "" >> recreate_db.ddl
|
echo "" >> recreate_db.ddl
|
||||||
fi
|
fi
|
||||||
#echo "create database 'localhost:$ALIAS';" >> recreate_db.ddl
|
#echo "create database 'localhost:$ALIAS';" >> recreate_db.ddl
|
||||||
echo "create database '$ALIAS';" >> recreate_db.ddl
|
echo "create database '$ALIAS' SET NAMES 'UTF8';" >> recreate_db.ddl
|
||||||
echo "commit;" >> recreate_db.ddl
|
echo "commit;" >> recreate_db.ddl
|
||||||
|
|
||||||
#echo "connect '$ALIAS';" >> recreate_db.ddl
|
#echo "connect '$ALIAS';" >> recreate_db.ddl
|
||||||
@ -450,13 +450,14 @@ echo "commit;" >> recreate_db.ddl
|
|||||||
#run creation script
|
#run creation script
|
||||||
if [ -f $ALIAS.sql ]; then
|
if [ -f $ALIAS.sql ]; then
|
||||||
echo Running $ALIAS.sql...
|
echo Running $ALIAS.sql...
|
||||||
${FIREBIRD_BIN}/isql -b -user FWFRAMEWORK_OWNER -pass masterkey -role RDB$ADMIN -e -i $ALIAS.sql -o $ALIAS.txt -m -m2 > /dev/null
|
${FIREBIRD_BIN}/isql -b -user DB_OWNER -pass masterkey -role RDB$ADMIN -e -i $ALIAS.sql -o $ALIAS.txt -m -m2 > /dev/null
|
||||||
else
|
else
|
||||||
echo Could not find $ALIAS.sql.
|
echo Could not find $ALIAS.sql.
|
||||||
echo Exiting.
|
echo Exiting.
|
||||||
exit;
|
exit;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# This should be part of recreate_db.ddl
|
||||||
if [ $(whoami) = "root" ]; then
|
if [ $(whoami) = "root" ]; then
|
||||||
chown firebird.firebird $DBFILENAME
|
chown firebird.firebird $DBFILENAME
|
||||||
chmod 660 $DBFILENAME
|
chmod 660 $DBFILENAME
|
||||||
@ -464,9 +465,13 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
#print errors
|
#print errors
|
||||||
echo Checking for Errors
|
echo
|
||||||
cat $ALIAS.txt | grep -B 16 -A 16 "Statement failed"
|
echo Checking for Errors...
|
||||||
if [ $? -gt 0 ]; then
|
echo
|
||||||
|
echo
|
||||||
|
#cat $ALIAS.txt | grep -B 16 -A 16 "Statement failed"
|
||||||
|
_err_count=$(cat $ALIAS.txt | grep -c "Statement failed")
|
||||||
|
if [ $_err_count -eq 0 ]; then
|
||||||
echo No errors found.
|
echo No errors found.
|
||||||
echo Script completed successfully.
|
echo Script completed successfully.
|
||||||
echo
|
echo
|
||||||
@ -474,9 +479,13 @@ if [ $? -gt 0 ]; then
|
|||||||
echo
|
echo
|
||||||
echo Here are the last lines from $ALIAS.txt
|
echo Here are the last lines from $ALIAS.txt
|
||||||
echo
|
echo
|
||||||
tail -n 20 $ALIAS.txt
|
tail -n 30 $ALIAS.txt
|
||||||
echo
|
else
|
||||||
|
echo Script failed with the following errors:
|
||||||
|
cat $ALIAS.txt | grep -B 3 -A 4 "Statement failed"
|
||||||
fi
|
fi
|
||||||
|
echo
|
||||||
|
echo
|
||||||
echo "$(date) Completed."
|
echo "$(date) Completed."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user