Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
Deleting S3 files using AWS data pipeline

I want to delete all S3 keys starting with some prefix using AWS data Pipeline. I am using AWS Shell Activity for this.

These are the argument

  "scriptUri": "https://s3.amazonaws.com/my_s3_bucket/hive/removeExitingS3.sh",
  "scriptArgument": "s3://my_s3_bucket/output/2017-03-19",

I want to delete all S3 keys starting with 2017-03-19 in output folder. What should be command to do this?

I have tried this command in .sh file

  sudo yum -y upgrade aws-cli 
  aws s3 rm $1 --recursive

This is not working.

Sample files are

s3://my_s3_bucket/output/2017-03-19/1.txt
s3://my_s3_bucket/output/2017-03-19/2.txt
s3://my_s3_bucket/output/2017-03-19_3.txt

EDIT:

The date(2017-03-19) is dynamic and this is output of #{format(@scheduledStartTime,"YYYY-MM-dd")}. So effectively

 "scriptArgument": "s3://my_s3_bucket/output/{format(@scheduledStartTime,"YYYY-MM-dd")}"
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Try

aws s3 rm $1 --recursive --exclude "*" --include "2017-03-19*" --include "2017-03-19/*"

with

"scriptArgument": "s3://my_s3_bucket/output/"

EDIT: As the date is a dynamic param, pass it as the second scriptArgument to the Shell command activity,

aws s3 rm $1 --recursive --exclude "*" --include "$2*" --include "$2/*"
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda