{"id":18585090,"url":"https://github.com/nallenscott/pvs3","last_synced_at":"2026-05-07T05:38:29.811Z","repository":{"id":177631288,"uuid":"658033371","full_name":"nallenscott/pvs3","owner":"nallenscott","description":"Use S3 to backup and restore directories located in a container or persistent volume 🪣","archived":false,"fork":false,"pushed_at":"2023-09-12T21:32:34.000Z","size":2129,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-13T21:44:11.197Z","etag":null,"topics":["aws","backup","docker","kubernetes","restore","s3"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nallenscott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-24T15:00:14.000Z","updated_at":"2023-07-14T12:40:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"c02e517a-95d1-40fa-9f55-baa053a2555f","html_url":"https://github.com/nallenscott/pvs3","commit_stats":null,"previous_names":["nallenscott/pvs3"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nallenscott/pvs3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nallenscott%2Fpvs3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nallenscott%2Fpvs3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nallenscott%2Fpvs3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nallenscott%2Fpvs3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nallenscott","download_url":"https://codeload.github.com/nallenscott/pvs3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nallenscott%2Fpvs3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32725071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","backup","docker","kubernetes","restore","s3"],"created_at":"2024-11-07T00:30:21.148Z","updated_at":"2026-05-07T05:38:29.785Z","avatar_url":"https://github.com/nallenscott.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"pvs3.png\" width=300 alt=\"\"\u003e\n\u003c/h1\u003e\n\npvs3 is a simple docker image for backing up and restoring directories using S3. It's based on [yacron](https://github.com/gjcarneiro/yacron), and is meant to be used as a sidecar for backups, or as an init container for restores.\n\n## Configuration\n\n| Env Variable | Description |\n| --- | --- |\n| `TARGET_DIR` | The directory to backup or restore |\n| `CRON_SCHEDULE` | The cron schedule for backups. This can be a string in a crontab format specified by [`parse-crontab`](https://github.com/josiahcarlson/parse-crontab) (the module used by yacron). |\n| `AWS_ACCESS_KEY_ID` | The AWS access key ID |\n| `AWS_SECRET_ACCESS_KEY` | The AWS secret access key |\n| `AWS_S3_BUCKET` | The AWS S3 bucket |\n| `AWS_S3_PREFIX` | The AWS S3 prefix |\n\n## Permissions\n\nThe following IAM policy is required for pvs3 to access the S3 bucket. Make sure attach it to the IAM user or role that pvs3 is running as. See [Adding and removing IAM identity permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html) for more information.\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"pvs3\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:ListBucket\",\n        \"s3:GetObject\",\n        \"s3:PutObject\"\n      ],\n      \"Resource\": [\n        \"arn:aws:s3:::\u003cAWS_S3_BUCKET\u003e\",\n        \"arn:aws:s3:::\u003cAWS_S3_BUCKET\u003e/\u003cAWS_S3_PREFIX\u003e/*\"\n      ]\n    }\n  ]\n}\n```\n\n## Backup\n\nFiles are stored in the target bucket/prefix as `backup-YYYY-MM-DD-HH-MM-SS.tar.gz`. You may need to include a volume mount for `/etc/yacron.d`, depending on your docker setup.\n\n### Docker\n\n```bash\ndocker run \\\n  -e TARGET_DIR=\"/var/lib/grafana\" \\\n  -e CRON_SCHEDULE=\"*/15 * * * *\" \\\n  -e AWS_ACCESS_KEY_ID=\"\u003cAWS_ACCESS_KEY_ID\u003e\" \\\n  -e AWS_SECRET_ACCESS_KEY=\"\u003cAWS_SECRET_ACCESS_KEY\u003e\" \\\n  -e AWS_S3_BUCKET=\"backups\" \\\n  -e AWS_S3_PREFIX=\"grafana\" \\\n  pvs3 backup\n```\n\n### Kubernetes\n\n```yaml\n# manifest.yaml\nextraContainers:\n  - name: backup\n    image: nallenscott/pvs3:latest\n    command: ['/pvs3/entrypoint.sh']\n    args: ['backup']\n    volumeMounts:\n      - name: storage\n        mountPath: /var/lib/grafana\n      - name: yacrontab\n        mountPath: /etc/yacron.d\n    env:\n      - name: TARGET_DIR\n        value: /var/lib/grafana\n      - name: CRON_SCHEDULE\n        value: \"*/15 * * * *\"\n      - name: AWS_ACCESS_KEY_ID\n        value: \u003cAWS_ACCESS_KEY_ID\u003e\n      - name: AWS_SECRET_ACCESS_KEY\n        value: \u003cAWS_SECRET_ACCESS_KEY\u003e\n      - name: AWS_DEFAULT_REGION\n        value: us-east-1\n      - name: AWS_S3_BUCKET\n        value: backups\n      - name: AWS_S3_PREFIX\n        value: grafana\n```\n\n## Restore\n\nThis will overwrite the contents of the target directory with the most recent backup.\n\n### Docker\n\n```bash\ndocker run \\\n  -e TARGET_DIR=\"/var/lib/grafana\" \\\n  -e AWS_ACCESS_KEY_ID=\"\u003cAWS_ACCESS_KEY_ID\u003e\" \\\n  -e AWS_SECRET_ACCESS_KEY=\"\u003cAWS_SECRET_ACCESS_KEY\u003e\" \\\n  -e AWS_S3_BUCKET=\"backups\" \\\n  -e AWS_S3_PREFIX=\"grafana\" \\\n  pvs3 restore\n```\n\n### Kubernetes\n\n```yaml\n# manifest.yaml\ninitContainers:\n  - name: restore\n    image: nallenscott/pvs3:latest\n    command: ['/pvs3/entrypoint.sh']\n    args: ['restore']\n    volumeMounts:\n      - name: storage\n        mountPath: /var/lib/grafana\n    env:\n      - name: TARGET_DIR\n        value: /var/lib/grafana\n      - name: AWS_ACCESS_KEY_ID\n        value: \u003cAWS_ACCESS_KEY_ID\u003e\n      - name: AWS_SECRET_ACCESS_KEY\n        value: \u003cAWS_SECRET_ACCESS_KEY\u003e\n      - name: AWS_DEFAULT_REGION\n        value: us-east-1\n      - name: AWS_S3_BUCKET\n        value: backups\n      - name: AWS_S3_PREFIX\n        value: grafana\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnallenscott%2Fpvs3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnallenscott%2Fpvs3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnallenscott%2Fpvs3/lists"}