My task is checking of the status of restoring process from glacier using rclone.
The new header (x-amz-optional-object-attributes: RestoreStatus) appeared in the s3 list API (please, check this). It would be helpful to add it to rclone lsf/lsjson commands for S3 backend (or create separated command like "rclone backend restore").
Another options is to use the response header (X-Amz-Restore) of HEAD S3 object request, which contains information about restoring status (ex.: X-Amz-Restore: ongoing-request="false", expiry-date="Thu, 07 Sep 2023 00:00:00 GMT"). [please, check this].
I have used the following command:
rclone lsjson -R --files-only config:bucket/some_dir --dump headers
I have seen the "X-Amz-Restore:" response header, which isn't used.
I searched almost everywhere and didn't find something similar. Maybe was I bad searcher?
Ok, but how can I recognize the case when the objects has been already restored?
I send a command rclone backend restore. It will give me output with "OK" statuses for files.
I send a command rclone backend restore once more time. It will give me output with "AlreadyInProgress" statuses for files. Internal S3 action: completed restoring process
I send a command rclone backend restore for the 3rd time. It will give me output with "OK" statuses for files (it seems it requests them again, although this files already are in standard storage).
It's unclear how to distinguish the cases:
when files were requested and they're not in the standard storage
Agree - there might be better ways. Rclone absolutely is not perfect - nothing is.
Given that you've already investigated AWS spec maybe you could give it a go and implement it using information you discovered? There is always room for making things better.
Hello,
That doesn't work, because when your objects have been moved to the glacier, their tier always will be 'GLACIER' or 'DEEP_ARCHIVE', regardless of whether it has been restored or not.
I'm not pro in AWS API, but there's new request 'RestoreStatus' option for x-amz-optional-object-attributes header of ListObjectsV2, then the following data will be appeared in the response:
I'm not so pro in the rclone architecture as active members, it will be able to take a long time. Therefore, I has proposed this as a new feature to implement by someone, which has more knowledgeable about the rclone architecture.
Thanks for the very quick reply.
I've tested it and it's what was needed.
As for "all" option, it seems to me that this option must be default, but with some other option like "skip nil" restore statuses to display only "not nil" restore statuses.
The decision is yours.
By the way, I've given it some thought and it seems it would be useful to add its current storage tier to the output of each object in case of "-o all" option. It make easier to distinguish between objects in the glacier and in the standard storage.
I hope I'm not puzzling you too much.
Thank you very much!
Yes due to the way it works it will only work for directories. It doesn't use the higher level listing routines, it has to use the low level ones which only list directories.