Restores an s3 bucket folder to the version at provided time.
It also creates an original folder backup with a .original
suffix.
Based on angeloc/s3-pit-restore.
- Bucket should have versioning enabled.
- AWS credentials file, provided by
AWS_FOLDER
. By default$HOME/.aws
.
make
Or make build
, will create a local container image.
Remember to add final slash to PREFIX
, otherwise s3 may take it as a file.
TIME="03-15-2021 20:00:00 +0" BUCKET="bucket_name" PREFIX="folder_path/" make restore
- It verifies there is no previous restore backup.
- Restores folder at provided point back in time, within new folder copy suffixed with
.restored
. - Verifies there is no previous original backup.
- Renames original folder with
.original
suffix. - Renames restored folder with original name.
if version_date > pit_end_date or version_date < pit_start_date:
TypeError: can't compare offset-naive and offset-aware datetimes
Date format is invalid.
Ensure that it follows this format "03-15-2020 20:00:00 UTC"
.