Skip to content

Commit 352acef

Browse files
committed
MISC: eos-diagnostic-tool use a configured DUMP_DIR if set
This allows for multiple similar scripts to dump to the same diagnostic trace folder which is useful when collecting other traces like network etc Fixes: EOSOPS-861 Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
1 parent 775e6fc commit 352acef

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

misc/sbin/eos-diagnostic-tool

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
# ************************************************************************
2424

2525
EXPORT_BASE_DIR="${EXPORT_BASE_DIR:-/tmp/eos-diagnostics}"
26-
DUMP_DIR="dump-$(date +"%Y%m%dT%H%M%S")"
27-
EXPORT_DIR="${EXPORT_BASE_DIR}/dumps/${DUMP_DIR}"
26+
DUMP_DIR="${DUMP_DIR:-${EXPORT_BASE_DIR}/dump-$(date +"%Y%m%dT%H%M%S")}"
27+
EXPORT_DIR="${DUMP_DIR}"
2828
TARBALL_DIR="${EXPORT_BASE_DIR}/tarballs"
2929

3030
# directory tree within the export dir for various info
@@ -161,9 +161,10 @@ get_config()
161161

162162
make_tarball()
163163
{
164-
DUMP_TARBALL="${TARBALL_DIR}/${DUMP_DIR}.tar.xz"
164+
local dump_dir_name="$(basename "${EXPORT_DIR}")"
165+
DUMP_TARBALL="${TARBALL_DIR}/${dump_dir_name}.tar.xz"
165166
pushd "$(dirname "${EXPORT_DIR}")" > /dev/null
166-
tar -cJf "${DUMP_TARBALL}" "${DUMP_DIR}"
167+
tar -cJf "${DUMP_TARBALL}" "${dump_dir_name}"
167168
log_info "Tarballs at ${DUMP_TARBALL}"
168169
popd > /dev/null
169170
}

0 commit comments

Comments
 (0)