AWS S3 Glacier Restore
Utility script to restore files on AWS S3 that have GLACIER storage class.
Features at a glance
- Calculates exact costs before restore
- Multithreaded API requests significantly reduce restore time
- Can check if all files for given prefix are already restored or not.
Installation and Upgrade
aws-s3-glacier-restore is developed in Python and uses pip.
The easiest way to install/upgrade s3select is to use pip in a virtualenv:
$ pip install -U aws-s3-glacier-restore
or, if you are not installing in a virtualenv, to install/upgrade globally:
$ sudo pip install -U aws-s3-glacier-restore
or for your user:
$ pip install --user -U aws-s3-glacier-restore
Authentication
aws-s3-glacier-restore uses the same authentication and endpoint configuration as aws-cli. If aws command is working on your machine, there is no need for any additional configuration.
Example usage
First get some help:
$ aws-s3-glacier-restore -h
usage: aws-s3-glacier-restore [-h] [-p PREFIX] [-i INPUT_FILE]
[-d DAYS_TO_KEEP] [-D DESTINATION_BUCKET]
[-t THREADS] [-s] [--profile PROFILE]
Utility script to restore files on AWS S3 that have GLACIER storage class
optional arguments:
-h, --help show this help message and exit
-p PREFIX, --prefix PREFIX
S3 prefix URL to restore
-i INPUT_FILE, --input_file INPUT_FILE
Input file containing all s3 paths to restore
-d DAYS_TO_KEEP, --days_to_keep DAYS_TO_KEEP
How many days to keep restored files
-D DESTINATION_BUCKET, --destination_bucket DESTINATION_BUCKET
Restore to this bucket instead of to original bucket
while preserving same path structure as in original
bucket. This is useful if you don't know for how long
you'll need restored files. Once you don't need them
you can delete them from destination bucket.
-t THREADS, --threads THREADS
Number of threads to use. Default=40
-s, --status_print Just print status of files and how many of them are in
glacier and how many of them are restored already
--profile PROFILE Use a specific AWS profile from your credential file.
Then full run might look like this:
$ aws-s3-glacier-restore -p s3://test-restore-bucket/backup2/image_1503789115/part-r-0003 -d 2 Getting a listing of the files to restore... Done About to restore 18.72GB in 10 files Restore will cost us: 1) Expedited tier: $0.66 2) Standard tier: $0.19 3) Bulk tier: $0.05 Keeping files on S3 will cost: 0.02 per day Press number in front of an option you wish or any other key to exit: 3 Starting restore using Bulk tier... Restoring backup2/image_1503789115/part-r-00030.gz Restoring backup2/image_1503789115/part-r-00031.gz Restoring backup2/image_1503789115/part-r-00032.gz Restoring backup2/image_1503789115/part-r-00034.gz Restoring backup2/image_1503789115/part-r-00036.gz Restoring backup2/image_1503789115/part-r-00038.gz Restoring backup2/image_1503789115/part-r-00033.gz Restoring backup2/image_1503789115/part-r-00037.gz Restoring backup2/image_1503789115/part-r-00035.gz Restoring backup2/image_1503789115/part-r-00039.gz Done Time elapsed: 2s
Parameter --days_to_keep (-d) specifies how long files will be accessible as regular files over S3. In case you have finished with files earlier than expected or want to extend the amount of days they are kept available, you can run the same command, but this time with modified "-d" parameter. If you specify "-d 1" this will signal that files should be archived back as soon as possible (usually happens within one day):
$ aws-s3-glacier-restore -p s3://test-restore-bucket/backup2/image_1503789115/part-r-0003 -d 0
If you want to check restore status of files you can use -s switch:
$ aws-s3-glacier-restore -p s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-0009 -s
Getting a listing of the files... Done
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00091 is being restored
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00092 is in Glacier and not being restored
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00093 is in Glacier and not being restored
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00095 is in Glacier and not being restored
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00094 is in Glacier and not being restored
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00090 is restored until Fri, 19 Oct 2018 00:00:00 GMT
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00098 is restored until Fri, 19 Oct 2018 00:00:00 GMT
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00096 is restored until Mon, 24 Sep 2018 00:00:00 GMT
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00099 is in Glacier and not being restored
Object s3://test-restore-bucket/archives/cars/GlacierImageArchive_2017_10-00000001-r-00097 is in Glacier and not being restored
Restored count: 3/10
License
Distributed under the MIT license. See LICENSE for more information.
Metadata
Release files for aws-s3-glacier-restore 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aws-s3-glacier-restore-0.0.4.tar.gz | 6.6 kB | Without provenance | Details for aws-s3-glacier-restore-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aws_s3_glacier_restore-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for aws_s3_glacier_restore-0.0.4-py3-none-any.whl |
Total release size: 14.5 kB
Release files / aws-s3-glacier-restore-0.0.4.tar.gz
| Download URL | aws-s3-glacier-restore-0.0.4.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a305a9cbd88e71397b774743b9ee7f0f938e36b88c9bb1a2afc109b2aa37643a
|
|
BLAKE2b-256 checksum How to use checksums |
3aceb3ba41fc5ff39b027dab4a77e2612a06645985ce84791505a655fa2e0fc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.16
|
Release files / aws_s3_glacier_restore-0.0.4-py3-none-any.whl
| Download URL | aws_s3_glacier_restore-0.0.4-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d92ee6b29dd9e5a88a5e40457c7ce78659f1b8cb36069b03441b104c3662bc1
|
|
BLAKE2b-256 checksum How to use checksums |
f90368fabae6d78df545f7c7ff9c18f1ca1f77ea3290365de4e6a048aa9344d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.16
|
Security for aws-s3-glacier-restore 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.