From c5e17c3d46322b3204d856dba30e6c6c3c391b70 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 26 Mar 2019 14:27:45 -0400 Subject: [PATCH] Make sure to keep the core file when creating the archive Remove the core file after creating the archive. Signed-off-by: Jonathan Rajotte --- scripts/lttng-tools/hang_processes.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/lttng-tools/hang_processes.sh b/scripts/lttng-tools/hang_processes.sh index f0d2ccf..34f8ef0 100755 --- a/scripts/lttng-tools/hang_processes.sh +++ b/scripts/lttng-tools/hang_processes.sh @@ -68,7 +68,7 @@ while read -r core_file; do collect_recursive "$str" done - rm -f "$core_file" + echo "$core_file" >> $file_list ret=1 done < <(find "/tmp" -maxdepth 1 -name "core\.[0-9]*" -type f 2>/dev/null) @@ -78,5 +78,10 @@ if [ -s "$file_list" ]; then tar cfzh "${WORKSPACE}/build/core.tar.gz" -T <(sort "$file_list" | uniq) fi +# Remove core file +while read -r core_file; do + rm -rf "$core_file" +done < <(find "/tmp" -maxdepth 1 -name "core\.[0-9]*" -type f 2>/dev/null) + rm -f "$file_list" exit $ret -- 2.34.1