Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Techsupport tmpfs logging #2979

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading