From 7a703aee5a39d0b4180897e924cc2d05b705d07c Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:43:24 +0800 Subject: [PATCH] fix show techsupport date issue (#3437) What I did Show techsupport is designed to collect logs and core files since given date. I find that some core files are missing when given date is relative, for example "5 minutes ago". Microsoft ADO: 28737486 How I did it Create the reference file at the start of the script, and don't update it in find_files. How to verify it Run end to end test: show_techsupport/test_auto_techsupport.py --- scripts/generate_dump | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/generate_dump b/scripts/generate_dump index 143ee502c..205e22fa7 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -1068,7 +1068,6 @@ save_file() { find_files() { trap 'handle_error $? $LINENO' ERR local -r directory=$1 - $TOUCH --date="${SINCE_DATE}" "${REFERENCE_FILE}" local -r find_command="find -L $directory -type f -newer ${REFERENCE_FILE}" echo $($find_command) @@ -1704,6 +1703,8 @@ main() { ${CMD_PREFIX}renice +5 -p $$ >> /dev/null ${CMD_PREFIX}ionice -c 2 -n 5 -p $$ >> /dev/null + # Created file as a reference to compare modification time + $TOUCH --date="${SINCE_DATE}" "${REFERENCE_FILE}" $MKDIR $V -p $TARDIR # Start with this script so its obvious what code is responsible