admin 管理员组文章数量: 1086019
I have various sub-directories inside my s3 bucket which contain 2 files, namely:
- pavement_suitability_final_result.gpkg
- Intermediate_Part1_output.gpkg
I wish to delete only the files named as Intermediate_Part1_output.gpkg, leaving the pavement_suitability_final_result.gpkg intact.
I tried the below commands, with no success:
aws s3 rm s3://aitl-data-bucket-backup/4_8_2_processed/ --recursive --exclude "pavement_suitability_final_result.gpkg" --include "Intermediate_Part1_output.gpkg" --dryrun
This deletes both the files ignoring my exclude command.aws s3 rm s3://aitl-data-bucket-backup/4_8_2_processed/ --recursive --exclude "*" --include "Intermediate_Part1_output.gpkg" --dryrun
This also deletes both the files ignoring my include command.
Tried various other combinations, but to no avail.
I have various sub-directories inside my s3 bucket which contain 2 files, namely:
- pavement_suitability_final_result.gpkg
- Intermediate_Part1_output.gpkg
I wish to delete only the files named as Intermediate_Part1_output.gpkg, leaving the pavement_suitability_final_result.gpkg intact.
I tried the below commands, with no success:
aws s3 rm s3://aitl-data-bucket-backup/4_8_2_processed/ --recursive --exclude "pavement_suitability_final_result.gpkg" --include "Intermediate_Part1_output.gpkg" --dryrun
This deletes both the files ignoring my exclude command.aws s3 rm s3://aitl-data-bucket-backup/4_8_2_processed/ --recursive --exclude "*" --include "Intermediate_Part1_output.gpkg" --dryrun
This also deletes both the files ignoring my include command.
Tried various other combinations, but to no avail.
Share Improve this question edited Mar 29 at 0:11 John Rotenstein 270k28 gold badges447 silver badges531 bronze badges Recognized by AWS Collective asked Mar 28 at 18:31 Swathi VenkateshSwathi Venkatesh 53 bronze badges 2 |1 Answer
Reset to default 0I suspect that it looks at the provided name as the full path of the object rather than just the 'filename' portion.
Try something like:
--exclude "*" --include "*/Intermediate_Part1_output.gpkg"
This will look for that filename in subdirectories too.
本文标签:
版权声明:本文标题:amazon web services - AWS CLI error with delete objects recursively using include, exclude - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744018742a2519410.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
--exclude "*" --include "*/Intermediate_Part1_output.gpkg"
to allow it to work in subdirectories too. – John Rotenstein Commented Mar 29 at 0:12