Skip to content

Commit

Permalink
Include /var/log.tmpfs in techsupport (#2979)
Browse files Browse the repository at this point in the history
Signed-off-by: Mihir Patel <patelmi@microsoft.com>
  • Loading branch information
mihirpat1 committed Sep 14, 2023
1 parent e2c1841 commit ff6f8f3
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -1441,18 +1441,36 @@ save_log_files() {
trap enable_logrotate HUP INT QUIT TERM KILL ABRT ALRM

start_t=$(date +%s%3N)
log_dir_1="/var/log/"
log_dir_2="/var/log.tmpfs/"
file_list=""

if [ -d "$log_dir_1" ]; then
file_list_1=$(find_files ${log_dir_1})
file_list="${file_list} ${file_list_1}"
fi

if [ -d "$log_dir_2" ]; then
file_list_2=$(find_files ${log_dir_2})
file_list="${file_list} ${file_list_2}"
fi

# gzip up all log files individually before placing them in the incremental tarball
for file in $(find_files "/var/log/"); do
for file in $file_list; do
dest_dir="log"
if [[ $file == *"tmpfs"* ]]; then
dest_dir="log.tmpfs"
fi
# ignore the sparse file lastlog
if [ "$file" = "/var/log/lastlog" ]; then
continue
fi
# don't gzip already-gzipped log files :)
# do not append the individual files to the main tarball
if [ -z "${file##*.gz}" ]; then
save_file $file log false
save_file $file $dest_dir false
else
save_file $file log true
save_file $file $dest_dir true
fi
done

Expand Down

0 comments on commit ff6f8f3

Please sign in to comment.