- 最新
- 投票最多
- 评论最多
The s3 sync
command doesn't support Glacier (mainly because you can't copy files directly from Glacier back to your local PC, you need to restore to S3-Standard storage first so a 2-way sync doesn't work).
The easiest solution would be to use your current approach to sync but configure a Lifecycle Rule to automatically move files within the appropriate destination S3 directory to Glacier Flexible Retrieval. You can set the Days after object creation value in the rule to 0 to ensure this happens immediately and restrict this rule to only operate on certain folders/prefixes.
This essentially automates the step in your current process where you are manually changing the storage class of newly uploaded objects to be Glacier Flexible Retrieval.
You should be aware that there are cost considerations in transitioning data from S3-Standard to S3 Glacier Flexible Retrieval which are detailed here. It is particularly worth noting that moving small files (under 128KB) to Glacier is not generally cost-efficient due to the minimum billable object size of 128KB plus the additional 40KB of metadata overhead. If you want to store many small files, consider combining them into a single, larger archive first.
Right, thank you. I wish I had known the 128 thing before doing my latest back-up, but its probably now not worth sorting out. (Though the vast majority of my files are above that threshold.) I have set the rule up to automatically transition files of 128kb and larger for future back-ips. When I next do the next one (in... May? after the 90-days passes) I will perhaps have a purge of the small files on AWS before I do the re-sync, such that they will be on standard.