Skip to content

Instantly share code, notes, and snippets.

@corrupt952
Last active September 8, 2022 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corrupt952/b4fe9a67e3524ef9f74b599badd466ad to your computer and use it in GitHub Desktop.
Save corrupt952/b4fe9a67e3524ef9f74b599badd466ad to your computer and use it in GitHub Desktop.
s3-pit-restore example

s3-pit-restore example

Recover s3 objects using s3-pit-restore.

Run

# Recover all objects
docker compose run -e AWS_PROFILE=default --rm -t app s3-pit-restore -b example-bucket -d ./objects -t "2022/08/10 10:00:00 +9"

# Recover any objects by specifying prefix
docker compose run -e AWS_PROFILE=default --rm -t app s3-pit-restore -b example-bucket -d ./objects -p prefix/path/to -t "2022/08/10 10:00:00 +9"

Tips

If you get the error s3-pit-restore: error: unrecognized arguments: 20:00:00 +09:00

If you get the error s3-pit-restore: error: unrecognized arguments: 20:00:00 +09:00, try switching to bash and running the shell.

services:
app:
build: .
volumes:
- .:/app
secrets:
- source: aws
target: /home/app/.aws
secrets:
aws:
file: ~/.aws
FROM python:3.7
RUN useradd -m app
USER app
WORKDIR /app
RUN pip3 --no-cache-dir install s3-pit-restore
ENV PATH /home/app/.local/bin:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment