{"id":16321242,"url":"https://github.com/beeb/awsbck","last_synced_at":"2025-03-16T14:31:03.872Z","repository":{"id":65755280,"uuid":"598470924","full_name":"beeb/awsbck","owner":"beeb","description":"Backup a folder to AWS S3, once or periodically","archived":false,"fork":false,"pushed_at":"2025-03-10T13:19:47.000Z","size":391,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T14:26:25.544Z","etag":null,"topics":["aws","aws-s3","backup","docker","s3","tools"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/awsbck","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beeb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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-02-07T07:10:35.000Z","updated_at":"2025-03-10T13:16:50.000Z","dependencies_parsed_at":"2023-10-03T11:36:22.344Z","dependency_job_id":"4be7339f-9c42-4600-9092-cf88a6a9b986","html_url":"https://github.com/beeb/awsbck","commit_stats":{"total_commits":146,"total_committers":1,"mean_commits":146.0,"dds":0.0,"last_synced_commit":"546c04587d96a1b9195a3cd7963c5cd7f525fbd3"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeb%2Fawsbck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeb%2Fawsbck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeb%2Fawsbck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeb%2Fawsbck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beeb","download_url":"https://codeload.github.com/beeb/awsbck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818195,"owners_count":20352629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","aws-s3","backup","docker","s3","tools"],"created_at":"2024-10-10T22:47:06.421Z","updated_at":"2025-03-16T14:31:03.359Z","avatar_url":"https://github.com/beeb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eawsbck\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/beeb/awsbck/actions/workflows/tests.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/beeb/awsbck/tests.yml?style=flat-square\u0026label=tests\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/awsbck\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/awsbck.svg?style=flat-square\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/beeb/awsbck/blob/main/LICENSE-MIT\"\u003e\u003cimg src=\"https://img.shields.io/crates/l/awsbck.svg?style=flat-square\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  This utility lets you compress a folder and upload it to a AWS S3 bucket, once or periodically.\n\u003c/p\u003e\n\n\u003chr/\u003e\n\n## Disclaimer\n\nThis software is in a beta stage and, although it has not caused any problems in testing, I wouldn't recommend it for\nproduction use.\n\nUse at your own risks!\n\nThe CLI will certainly change, but any breaking change should mean an increase in the minor version number as per semver\n, until it reaches `1.0.0`. New features that are backwards-compatible and bug fixes will lead to patch number bumps\nuntil then.\n\n## Usage\n\n```\nUsage: awsbck [OPTIONS] --bucket \u003cBUCKET\u003e --id \u003cKEY_ID\u003e --key \u003cKEY\u003e \u003cFOLDER\u003e\n\nArguments:\n  \u003cFOLDER\u003e  Path to the folder to backup [env: AWSBCK_FOLDER=]\n\nOptions:\n  -c, --cron \u003cEXPR\u003e      Specify a cron espression to run the backup on a schedule [env: AWSBCK_CRON=]\n  -f, --filename \u003cNAME\u003e  The name of the archive that will be uploaded to S3, without extension (optional) [env: AWSBCK_FILENAME=]\n  -r, --region \u003cREGION\u003e  The AWS S3 region [env: AWS_REGION=] [default: us-east-1]\n  -b, --bucket \u003cBUCKET\u003e  The AWS S3 bucket name [env: AWS_BUCKET=]\n      --id \u003cKEY_ID\u003e      The AWS S3 access key ID [env: AWS_ACCESS_KEY_ID=]\n  -k, --key \u003cKEY\u003e        The AWS S3 secret access key [env: AWS_SECRET_ACCESS_KEY=]\n  -h, --help             Print help (see more with '--help')\n  -V, --version          Print version\n```\n\nCLI arguments take precedence over environment variables.\n\nThe cron expression is parsed by the [`cron`](https://github.com/zslayton/cron) crate, with the following format (year\nis optional):\n\n```rust\n//                sec, min, hour,   day of month, month,  day of week, year\nlet expression = \"0    30   9,12,15 1,15          May-Aug Mon,Wed,Fri  2018/2\";\n```\n\nThe `--filename` option accepts ASCII alphanumeric characters and `!-_.*'()/`. Other characters will be discarded.\n\n### Example\n\n```shell\n# The .env file in the current directory is read by awsbck\n$ cat .env\nAWS_REGION=\"eu-central-1\"\nAWS_ACCESS_KEY_ID=\"YOUR_KEY_ID\"\nAWS_SECRET_ACCESS_KEY=\"yoursecret\"\n\n$ awsbck -c \"@hourly\" -b my_bucket /my_folder\n```\n\n### Docker example\n\n```\n$ export AWS_REGION=\"eu-central-1\"\n$ export AWS_ACCESS_KEY_ID=\"YOUR_KEY_ID\"\n$ export AWS_SECRET_ACCESS_KEY=\"yoursecret\"\n$ docker run \\\n  --rm \\\n  --mount type=bind,src=\"$(pwd)\"/target,dst=/target,readonly \\\n  -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \\\n  ghcr.io/beeb/awsbck:latest \\\n  -c \"15 */10 * * * *\" -b my_bucket /target\n```\n\n## Installation\n\n### Prebuilt binaries\n\nCheck out [the releases](https://github.com/beeb/awsbck/releases) for prebuilt binaries.\n\n### Cargo\n\n```shell\n$ cargo install awsbck\n```\n\n### Nix\n\nAvailable through nixpkgs on the unstable channel.\n\n```shell\n$ nix-env -iA nixpkgs.awsbck\n```\n\n### Docker\n\nThis utility is available as a\n[docker image `ghcr.io/beeb/awsbck`](https://github.com/beeb/awsbck/pkgs/container/awsbck).\n\nThere are two tag variants, one running as a non-root user (`latest`) and one as a root user (`root-latest`).\n\nThis image is particularly useful to backup named volumes in docker. If you encounter problems where the `awsbck` logs\nreport a permissions problem, then you can try to switch to the `root-latest` tag.\n\nBelow an example of using it with `docker compose`. In order to make sure the backup happens properly, we can't just\ncopy the db data, as it might be in the middle of a write or other operation. Thus we send the `pg_dumpall` command\nand store the resulting dump to a separate volume that we can backup to S3.\n\n```yml\n---\nversion: '3.2'\n\nvolumes:\n  # the first volume is to persist the database raw data\n  database:\n  # this volume will be used to share the dump file with awsbck\n  database-backup:\n\nservices:\n  postgresql:\n    image: postgres:14\n    restart: unless-stopped\n    volumes:\n      - type: volume\n        source: database\n        target: /var/lib/postgresql/data/\n      - type: volume\n        source: database-backup\n        target: /backup\n  # this service will send a dump command to the postgres container periodically (here 6h)\n  # and store the resulting file in the `database-backup` volume mounted at `/backup`\n  postgres-backup:\n    image: docker:cli\n    container_name: postgres_backup\n    volumes:\n      - type: bind\n        source: /var/run/docker.sock\n        target: /var/run/docker.sock\n    command:\n      [\n        '/bin/sh',\n        '-c',\n        'while true; do sleep 21600; docker exec -t postgres pg_dumpall -c -U postgres \u003e /backup/dump_database.sql; done'\n      ]\n  # we mount the backup volume as read-only and back up the SQL dump daily at 3.12am\n  awsbck:\n    image: ghcr.io/beeb/awsbck:latest\n    restart: unless-stopped\n    volumes:\n      - type: volume\n        source: database-backup\n        target: /database\n        read_only: true\n    environment:\n      AWSBCK_FOLDER: /database\n      AWSBCK_CRON: '0 12 3 * * * *'\n      AWS_REGION: eu-central-1\n      AWS_BUCKET: my_bucket\n      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID\n      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeeb%2Fawsbck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeeb%2Fawsbck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeeb%2Fawsbck/lists"}