summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-04 13:35:05 +0100
committerErich Eckner <git@eckner.net>2020-02-04 13:35:05 +0100
commit6df5b189676fd9877ff2168e03779a667d59259c (patch)
tree5ef7d56dff6f9f706829c768183f7c5ba742675b /lib
parent309f52b28e23d58a8c890f05958eb97d1581254b (diff)
downloadbuilder-6df5b189676fd9877ff2168e03779a667d59259c.tar.xz
lib/mysql-functions: save permanent copies of *successful* mysql queries
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mysql-functions8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index f84cb8b..4bd1164 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -53,11 +53,13 @@ mysql_run_query() {
if [ -f "${query_stdout}" ]; then
wait_some_time 10 10
fi
- ${mysql_command} -N --raw --batch "$@" \
+ if ${mysql_command} -N --raw --batch "$@" \
< "${query_stdin}" \
> "${query_stdout}" \
- 2>> "${query_stderr}" \
- && rm "${query_stdin}" "${query_stderr}"
+ 2>> "${query_stderr}"; then
+ mv "${query_stdin}" "${work_dir}/successful.${query_stdin##*/}"
+ rm "${query_stderr}"
+ fi
if ! [ -f "${query_stdin}" ]; then
# success!
break