BASH & MYSQL - logg mysql problems during running of a bash/sh script -


i building bash script makes lot of use of mysql. want add possibility log down comments/errors come database. lets admit simple case.

mysql -uuser -ppass dbase <<eof insert table (col) values ("$val"); eof 

how logging /var/log/mylamescript ? want log warnings, errors, etc ... except "successful"

you have redirect standard error appending log file:

mysql -uuser -ppass dbase <<eof 2>> /var/log/mylamescript      insert table (col) values ("$val"); eof 

Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -