Skip to content

Instantly share code, notes, and snippets.

@corrupt952
Last active September 8, 2022 11:00
Show Gist options
  • Save corrupt952/b4fe9a67e3524ef9f74b599badd466ad to your computer and use it in GitHub Desktop.
Save corrupt952/b4fe9a67e3524ef9f74b599badd466ad to your computer and use it in GitHub Desktop.

Revisions

  1. corrupt952 revised this gist Sep 8, 2022. No changes.
  2. corrupt952 revised this gist Sep 8, 2022. 3 changed files with 38 additions and 1 deletion.
    7 changes: 7 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    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
    20 changes: 19 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,19 @@
    test
    # s3-pit-restore example

    Recover s3 objects using [s3-pit-restore](https://github.com/angeloc/s3-pit-restore).

    ## Run

    ```sh
    # 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.
    12 changes: 12 additions & 0 deletions compose.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    services:
    app:
    build: .
    volumes:
    - .:/app
    secrets:
    - source: aws
    target: /home/app/.aws

    secrets:
    aws:
    file: ~/.aws
  3. corrupt952 created this gist Sep 8, 2022.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    test