Categories
Uncategorized

S3 CLI Jobs

Move batch of files with a pattern. (Delete –dry-run to do it for real)

aws s3 mv s3://mybucket/path/ s3://mybucket/newpath/ --recursive --exclude "*" --include "my_pattern*.gz" --dryrun 

Find some objects with the deprecated Reduced Redundancy Storage type to migrate

aws s3api list-objects-v2 --bucket mybucket --max-item 200 --start-after "somepath" --query 'Contents[?StorageClass==`REDUCED_REDUNDANCY`][Key]'