Skip to content

Commit 0e18807

Browse files
authored
Refresh dump file modify timestamp before cleanup call (sonic-net#3595)
During the show techsupport, generate_dump calls techsupport_cleanup with current generated file. The techsupport_cleanup verifies the file path provided for file last modification timestamp and on success only proceeds to cleanup. It expects the file to be modified within last 20 secs. Sometimes when file is big, gzip takes more that 20 sec. Due to this, the last modify timestamp to current time stamp diff is greater than 20 and verify_recent_file_creation fails causing cleanup to fail. How I did it touch the tarfile after finishing the gzip to refresh modify timestamp. How to verify it run show techsupport
1 parent 8f3c5ef commit 0e18807

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/generate_dump

+3
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,9 @@ finalize() {
22232223
else
22242224
echo "WARNING: gzip operation appears to have failed." >&2
22252225
fi
2226+
# sometimes gzip takes more than 20 sec to finish, causing file time create validation
2227+
# to fail. touching the tarfile created to refresh modify time.
2228+
touch ${TARFILE}
22262229
fi
22272230

22282231
# Invoke the TechSupport Cleanup Hook

0 commit comments

Comments
 (0)