Skip to content

Commit

Permalink
log-files-clean*sh less aggressive cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmoon79 committed Mar 17, 2024
1 parent 2d3aae6 commit 2c34a47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
15 changes: 0 additions & 15 deletions tools/log-files-clean-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,6 @@ fi
for path in "${@}"; do
(
set -x
# remove non-plain-text non-syslog files
find "${path}" -xdev \
-type f \
\( \
-name '*.tar' -or \
-name '*.gz' -or \
-name '*.xz' -or \
-name '*.json' -or \
-name '*.xml' -or \
-name 'btmp' -or \
-name 'wtmp' -or \
-name 'faillog' -or \
-name 'lastlog' \
\) \
-print -delete
# remove empty files
find "${path}" -xdev \
-type f \
Expand Down
8 changes: 5 additions & 3 deletions tools/log-files-clean-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ function replace_MAC () {
}

function replace_IPv4 () {
# TODO: this must replace the IPv4 with the same string length IPv4
# otherwise fixedstruct files are broken
# found
# 10.100.244.33
# becomes
Expand Down Expand Up @@ -196,10 +198,10 @@ function replace() {
# could be more efficient by combining these into one call to `sed`
# but *meh*, this script is run rarely, so good enough
replace_MAC "${@}"
replace_IPv4 "${@}"
# replace_IPv4 "${@}"
replace_GUID "${@}"
replace_port "${@}"
replace_num "${@}"
# replace_num "${@}"
replace_SSH_hash "${@}"
replace_user_passed "${@}"
}
Expand Down Expand Up @@ -263,7 +265,7 @@ Number 12345678
fi

for file in "${@}"; do
trunc "${file}"
# trunc "${file}"
replace "${file}"
echo -e "\e[1m\e[93m${file}\e[0m" >&2
cat "${file}"
Expand Down

0 comments on commit 2c34a47

Please sign in to comment.