I want to delete folders from aws s3 my-bucket which are older than 2023-05-01 and folder names which starts with "000". using AWS CLI
I can delete folders and files which starts with "000" using :
aws s3 rm s3://my-bucket --exclude "*" --include "000*" --recursive
now i want to add date condition into it. How can I achieve it?
I tried
aws s3 rm s3://my-bucket/ | awk '$1< "2023-10-28 11:30:15" {print $0}'
but it didnt work. Its saying he system can not find file specified
aws s3 rmon the bucket and then piping the output of that command toawk. It doesn't, in any way, modify what theaws s3 rmcommand does.aws s3 rm. Note: folders don't have a last modified date in S3 (because there typically are no actual folders, they're virtual).