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

Shellcheck fixes

parent 4246b320
Branches
No related tags found
1 merge request!1MVP
Pipeline #1820 passed
#!/bin/bash #!/bin/bash
export BUCKET_NAME=$(cat /s3_bucket) BUCKET_NAME=$(cat /s3_bucket)
export EXPIRE_AGE_DAYS=$(cat /s3_expire_days) 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 do
createDate=`echo $line|awk {'print $1" "$2'}` createDate=$(echo "$line"|awk '{print $1" "$2}')
createDate=`date -d"$createDate" +%s` createDate=$(date -d"$createDate" +%s)
olderThan=`date -d"-$EXPIRE_AGE_DAYS" +%s` olderThan=$(date -d"-$EXPIRE_AGE_DAYS" +%s)
if [[ $createDate -lt $olderThan ]] if [[ $createDate -lt $olderThan ]]
then then
fileName=`echo $line|awk {'print $4'}` fileName=$(echo "$line"|awk '{print $4}')
echo $fileName echo "$fileName"
if [[ $fileName != "" ]] if [[ $fileName != "" ]]
then then
s4cmd --config=/s3_config del "$fileName" s4cmd --config=/s3_config del "$fileName"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment