Skip to content

Commit

Permalink
Fixed s3 upload
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Oct 14, 2024
1 parent ffafe04 commit db3e215
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions extract_goaccess_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ metrics(){
done
}

for log in "$CLUSTER_LOGS_DIR"/*;
for log_path in "$CLUSTER_LOGS_DIR"/*;
do
if [[ $log == *"oscar_oscar"* ]]; then
cp -r $log $LOCAL_LOGS_DIR
# upload a backup of the logs to s3
aws s3 cp --recursive $log s3://metrics.oscar.grycap.net/"${CLUSTER_ID}"/ingresslogs/
if [[ $log_path == *"oscar_oscar"* ]]; then
cp -r $log_path $LOCAL_LOGS_DIR
# remove total path
log=$(echo $log | sed 's/\/var\/log\/clusterlogs\///')
for logfile in "$LOCAL_LOGS_DIR/$log/oscar/"*;
log_relative_path=$(echo $log | sed 's/\/var\/log\/clusterlogs\///')
# upload a backup of the logs to s3
aws s3 cp --recursive $log_path s3://metrics.oscar.grycap.net/"${CLUSTER_ID}"/ingresslogs/"${log_relative_path}"
for logfile in "$LOCAL_LOGS_DIR/$log_relative_path/oscar/"*;
do
if [[ $logfile == *".gz" ]]; then
# unzip all log files
Expand Down

0 comments on commit db3e215

Please sign in to comment.