From 3771352050c5cf1a103af8faf0711164d724083b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 4 Feb 2020 22:22:59 +0100 Subject: lib/mysql-functions: save input files of successful queries, too --- lib/mysql-functions | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/mysql-functions b/lib/mysql-functions index 5173bfb..daef65b 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -58,6 +58,14 @@ mysql_run_query() { > "${query_stdout}" \ 2>> "${query_stderr}"; then if grep -qF 'DELETE `binary_packages' "${query_stdin}"; then + sed -n ' + s/^.*INFILE "\(\S\+\)".*$/\1/ + T + p + ' "${query_stdin}" | \ + while read -r file; do + cp "${file}" "${work_dir}/successful.${query_stdin##*/}.infile.${file##*/}" + done mv "${query_stdin}" "${work_dir}/successful.${query_stdin##*/}" else rm "${query_stdin}" -- cgit v1.2.3-70-g09d2