{"id":20693258,"url":"https://github.com/maxakuru/git-backup","last_synced_at":"2025-03-11T01:48:33.369Z","repository":{"id":49371405,"uuid":"517526345","full_name":"maxakuru/git-backup","owner":"maxakuru","description":"Sync files/folders to git repositories, schedule with Docker image","archived":false,"fork":false,"pushed_at":"2022-11-01T15:33:19.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T17:40:17.479Z","etag":null,"topics":["automation","backup","data-storage","docker","git","github","raspberry-pi","sync"],"latest_commit_sha":null,"homepage":"","language":"Python","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/maxakuru.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}},"created_at":"2022-07-25T05:13:30.000Z","updated_at":"2022-07-26T05:54:10.000Z","dependencies_parsed_at":"2023-01-20T18:20:20.345Z","dependency_job_id":null,"html_url":"https://github.com/maxakuru/git-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxakuru%2Fgit-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxakuru%2Fgit-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxakuru%2Fgit-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxakuru%2Fgit-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxakuru","download_url":"https://codeload.github.com/maxakuru/git-backup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242956549,"owners_count":20212454,"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":["automation","backup","data-storage","docker","git","github","raspberry-pi","sync"],"created_at":"2024-11-16T23:25:56.897Z","updated_at":"2025-03-11T01:48:33.351Z","avatar_url":"https://github.com/maxakuru.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-backup\n\n[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/maxakuru/git-backup?label=Docker%20image)](https://hub.docker.com/r/maxakuru/git-backup) [![Publish](https://github.com/maxakuru/git-backup/actions/workflows/publish.yml/badge.svg)](https://github.com/maxakuru/git-backup/actions/workflows/publish.yml) [![Test](https://github.com/maxakuru/git-backup/actions/workflows/test.yml/badge.svg)](https://github.com/maxakuru/git-backup/actions/workflows/test.yml)\n\n```\n🚨 Git is not designed to serve as a backup tool.\n```\n\n..but this does it anyway. Backup files/folders to a git repo. Run on a cron schedule or repeated loop with delay. Archive files/folders and set specific destinations in remote repository. Use Git LFS or chunking for oversized files.\n\n## Install\n\n### With Docker\n```sh\ndocker pull maxakuru/git-backup\n```\n```sh\ndocker run -it --rm \\\n    -v $PWD/config:/backup/config \\\n    -v $PWD/repos:/backup/repos \\\n    -v $PWD/secrets:/backup/secrets \\\n    -e REPO_NAME=\u003cREPO_NAME\u003e \\\n    -e REPO_OWNER=\u003cGIT_OWNER\u003e \\\n    -e GIT_TOKEN=\u003cGIT_PATOKEN\u003e \\\n    -e PATHS=local/path/one:remote/path/one,local/path/two:remote/path/two \\\n    -e LOOP=\u003cfalse|true\u003e \\\n    -e LOOP_INTERVAL=\u003cminutes (float)\u003e \\\n    -e LOOP_SCHEDULE=\u003ccrontab expression (string)\u003e \\\n    -e COMPRESS=\u003czip|tar|gztar|bztar|xztar|true|false\u003e \\\n    -e SAVE_CONFIG=\u003cbool\u003e \\\n    -e SAVE_SECRETS=\u003cbool\u003e \\\n    -e GIT_ADD=\u003cbool\u003e \\\n    -e GIT_COMMIT=\u003cbool\u003e \\\n    -e GIT_PUSH=\u003cbool\u003e \\\n    -e GIT_MESSAGE=\u003cstring\u003e \\\n    -e GIT_EMAIL=\u003cstring\u003e \\\n    -e GIT_NAME=\u003cstring\u003e \\\n    -e LOG_LEVEL=\u003c0|1|2|3|4|5\u003e \\\n    maxakuru/git-backup\n```\n\n## With Docker Compose\n```yaml\n# docker-compose.yaml\nbackup:\n    container_name: backup\n    image: maxakuru/git-backup:latest\n    restart: always\n    environment:\n        - REPO_NAME=\u003cREPO_NAME\u003e\n        - REPO_OWNER=\u003cREPO_OWNER\u003e\n        - GIT_TOKEN=\u003cGIT_TOKEN\u003e\n        # - ... see above\n```\n\n\n## Dev\n\n### Run with local changes\n```sh\ndocker run -it --rm -v $PWD/volume:/backup/config \\\n    -v $PWD/git_backup:/backup/git_backup \\\n    -e REPO_NAME=\u003cREPO_NAME\u003e \\\n    -e REPO_OWNER=\u003cREPO_OWNER\u003e \\\n    -e GIT_TOKEN=\u003cGIT_TOKEN\u003e \\\n    -e PATHS=\u003cPATHS\u003e \\\n    maxakuru/git-backup:dev\n```\n\n### Test\n```sh\necho \"MY_GITHUB_TOKEN=\u003cGITHUB_PAT\u003e \u003e\u003e .env\"\n./test/functional/test.sh\n```\n\n### Build\n```sh\ndocker build -t maxakuru/git-backup:dev .\n```\n\n### Run\n```sh\ndocker run -it --rm -v $PWD/volume:/backup/config \\\n    -e REPO_NAME=\u003cREPO_NAME\u003e \\\n    -e REPO_OWNER=\u003cREPO_OWNER\u003e \\\n    -e GIT_TOKEN=\u003cGIT_TOKEN\u003e \\\n    -e PATHS=\u003cPATHS\u003e \\\n    maxakuru/git-backup:dev\n```\n\n### Open shell\n```sh\ndocker run -it --rm -e=\"CLI=true\" -v $PWD/volume:/backup/config maxakuru/git-backup:dev /bin/bash\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxakuru%2Fgit-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxakuru%2Fgit-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxakuru%2Fgit-backup/lists"}