Skip to content
Snippets Groups Projects
Commit ece60a79 authored by Erick Hitter's avatar Erick Hitter
Browse files

Shellcheck fixes

parent 4246b320
No related branches found
No related tags found
1 merge request!1MVP
Pipeline #1820 passed with stages
in 2 minutes and 54 seconds
#!/bin/bash
export BUCKET_NAME=$(cat /s3_bucket)
export EXPIRE_AGE_DAYS=$(cat /s3_expire_days)
BUCKET_NAME=$(cat /s3_bucket)
export BUCKET_NAME
s4cmd --config=/s3_config ls s3://$BUCKET_NAME | while read -r line;
EXPIRE_AGE_DAYS=$(cat /s3_expire_days)
export EXPIRE_AGE_DAYS
s4cmd --config=/s3_config ls s3://"${BUCKET_NAME}" | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date -d"-$EXPIRE_AGE_DAYS" +%s`
createDate=$(echo "$line"|awk '{print $1" "$2}')
createDate=$(date -d"$createDate" +%s)
olderThan=$(date -d"-$EXPIRE_AGE_DAYS" +%s)
if [[ $createDate -lt $olderThan ]]
then
fileName=`echo $line|awk {'print $4'}`
echo $fileName
fileName=$(echo "$line"|awk '{print $4}')
echo "$fileName"
if [[ $fileName != "" ]]
then
s4cmd --config=/s3_config del "$fileName"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment