Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
code: set LC_ALL to C for date command usage
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
  • Loading branch information
galexrt committed Jun 24, 2022
1 parent b850a85 commit 7180048
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gather-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ gatherCephCommands() {
}

packInfo() {
TAR_FILE="${CWD}/$(date +"%s-%Y-%m-%D")-koor-gather-info.tar.gz"
OLD_LC_ALL="$LC_ALL"
# Override to make sure the date / time format isn't breaking the tar file name
export LC_ALL="C"

TAR_FILE="${CWD}/$(date +"%s-%Y-%m-%d")-koor-gather-info.tar.gz"

tar cfvz "${TAR_FILE}" "${INFO_TMP_DIR}"
echo "gather-info: Info dump tar available at: ${TAR_FILE}"
LC_ALL="$OLD_LC_ALL"
}

enableDebugLog() {
Expand Down Expand Up @@ -144,4 +149,4 @@ else
echo "gather-info: Skipped tar packing of info dump."
fi

echo "gather-info: Starting at $(date +%s) ..."
echo "gather-info: Done at $(date +%s)."

0 comments on commit 7180048

Please sign in to comment.