Change AWS S3 storage class from standard to One zone IA

The best way to do this instead of using the GUI from aws is this way:

aws s3 ls bucket-1-zone --profile aws >> bucket-1-zone.out

for i in `cat bucket-1-zone.out|awk ' {print $4}'`; do aws s3 cp s3://bucket-1-zone/$i s3://bucket-1-zone/$i --storage-class=ONEZONE_IA --profile aws ; done

POSTED ON