Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
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")}"
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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/*"
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda