Skip to content

Commit

Permalink
Ensure locales don't mess with the date formats, where UTC where it m…
Browse files Browse the repository at this point in the history
…akes sense

For the timestamp variable used in the filename uploaded to s3 this is crucial,
 ref: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html
  • Loading branch information
michaelsembwever committed Aug 30, 2024
1 parent 7ca3b83 commit e5823a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ds-collector/ds-collector
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ connection_test() {
if [ "$enablePingTest" ]; then one_ping_only "$hostName"; fi
baseMessage="connection test to $hostName"
echo -e \\n"starting $baseMessage"
node_connect 'date'
node_connect 'date -R'
print_status_state
}

Expand Down Expand Up @@ -332,7 +332,7 @@ bucket_dump() {
unset -v artifacts
artifacts=($baseDir/*artifacts*.tar.gz)

timestamp=$(date +"%b-%d-%H-%M")
timestamp=$(date -u +"%Y-%m-%dT%H%M%S")

for artifact in "${artifacts[@]}"
do
Expand Down Expand Up @@ -362,7 +362,7 @@ bucket_dump() {
}

upload() {
timestamp=$(date +"%b-%d-%H-%M")
timestamp=$(date -u +"%Y-%m-%dT%H%M%S")
if [[ -d "${uploadMode}" ]] ; then
for file in "${uploadMode}"/* ; do
if [[ -f "$file" ]]; then
Expand Down Expand Up @@ -1113,7 +1113,7 @@ get_info() {
####### main
# The more complex construct is more reliable than: script_directory=$(dirname "$0")
script_directory=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
date=$(date +'%Y_%m_%d_%H%M_%s')
date=$(date -u +'%Y_%m_%d_%H%M_%s')
baseDir="/tmp/datastax"
artifactDir="$baseDir/$(hostname)_artifacts_$date"
artifactFile="latest_artifacts.txt"
Expand Down Expand Up @@ -1262,7 +1262,7 @@ if [ $debug ] ; then
fi
if [ $verbose ] ; then
bastion_checks
logFile="${baseDir}/ds-collector-$(date +'%Y-%m-%d-%H-%M-%s').log"
logFile="${baseDir}/ds-collector-$(date -u +'%Y-%m-%d-%H-%M-%s').log"
echo "debugging to ${logFile}"
( exec $0 ${@/-v/-x} ) 2>&1 | sed "s/${jmxPassword:-\*\*\*\*}/****/g" | sed "s/${cqlshPassword:-\*\*\*\*}/****/g" | tee "${logFile}"
exit $?
Expand Down

0 comments on commit e5823a8

Please sign in to comment.