title: Deleting S3 files using AWS data pipeline
body: <p>I want to delete all S3 keys starting with some prefix using AWS data Pipeline.
  I am using AWS Shell Activity for this. </p>
  
  <p>These are the argument </p>
  
  <pre><code>  "scriptUri": "https://s3.amazonaws.com/my_s3_bucket/hive/removeExitingS3.sh",
    "scriptArgument": "s3://my_s3_bucket/output/2017-03-19",
  </code></pre>
  
  <p>I want to delete all S3 keys starting with 2017-03-19 in output folder. What should be command to do this?</p>
  
  <p>I have tried this command in <code>.sh</code> file </p>
  
  <pre><code>  sudo yum -y upgrade aws-cli 
    aws s3 rm $1 --recursive
  </code></pre>
  
  <p>This is not working.</p>
  
  <p>Sample files are </p>
  
  <pre><code>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
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The date(2017-03-19) is dynamic and this is output of #<code>{format(@scheduledStartTime,"YYYY-MM-dd")}</code>. So effectively </p>
  
  <pre><code> "scriptArgument": "s3://my_s3_bucket/output/{format(@scheduledStartTime,"YYYY-MM-dd")}"
  </code></pre>