Answer the question
In order to leave comments, you need to log in
How to save bash script output to database?
Hello everyone,
you need a bash script that ssh into a remote computer and executes various commands there, such as updating the local repo, running other scripts, restarting docker containers, etc.
How can I make the output from this script, including the error output, be saved to the database? In any format!
Maybe it's better to use ansible instead of a script? Is it possible to save its output to the database? What database is better to use for such logs?
thanks
Answer the question
In order to leave comments, you need to log in
Ansible is better. Ansible output is saved to the log. The log can be parsed and put into the database. You can do the same with script output.
Simplest
mysql -uПОЛЬЗОВАТЕЛЬ -pПАРОЛЬ БАЗА ДАННЫХ <<EOF
SQL_ЗАПРОС_1
SQL_ЗАПРОС_2
SQL_ЗАПРОС_N
EOF
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question