Skip to content

Commit

Permalink
fix import to handle archive in subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
randytpierce committed Jan 5, 2024
1 parent 6a6d142 commit 73e0c5e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/VXingest_utilities/run-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ ls -1 ${load_dir}/*.gz | while read f; do
echo "processing the tar file ${f}"
echo "extracting tarball ${f} to temp_dir ${t_dir}"
echo "tar -xzf ${f} -C ${t_dir}"
tar -xzf "${f}" -C "${t_dir}"
# NOTE: the archives are tar'd into a subdirectory so strip-components 1
tar -xzf "${f}" -C "${t_dir}" --strip-components 1
if [[ $? != 0 ]]; then
echo "ERROR: tarball ${f} failed to extract"
base_f=$(basename $f)
Expand All @@ -136,7 +137,7 @@ ls -1 ${load_dir}/*.gz | while read f; do
rm -rf ${t_dir}/*
continue # go to the next tar file
fi
echo "finished extracting tarball ${f}"
echo "finished extracting tarball ${f} to ${t_dir}"
log_file_count=`ls -1 ${t_dir}/*.log | wc -l`
if [[ ${log_file_count} -ne 1 ]]; then
echo "There is not just one log_file in ${t_dir} - extracted from ${f} - there are ${log_file_count}"
Expand Down

0 comments on commit 73e0c5e

Please sign in to comment.