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

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -