{"id":15684757,"url":"https://github.com/halvardssm/git-backup","last_synced_at":"2026-05-01T14:34:13.250Z","repository":{"id":132678147,"uuid":"450972406","full_name":"halvardssm/git-backup","owner":"halvardssm","description":"A Git repo backup service written in Rust","archived":false,"fork":false,"pushed_at":"2022-10-10T17:02:23.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T10:45:18.549Z","etag":null,"topics":["backup","backup-tool","git","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halvardssm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-01-23T00:53:36.000Z","updated_at":"2024-12-05T13:59:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"541a3f13-214a-4af3-b68d-8f04bbabca21","html_url":"https://github.com/halvardssm/git-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/halvardssm/git-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fgit-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fgit-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fgit-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fgit-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halvardssm","download_url":"https://codeload.github.com/halvardssm/git-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fgit-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32501403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["backup","backup-tool","git","rust"],"created_at":"2024-10-03T17:21:42.802Z","updated_at":"2026-05-01T14:34:13.214Z","avatar_url":"https://github.com/halvardssm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Backup Script\n\n\u003e This is a script for personal usage. That means that breaking changes can occur at any time. If someone finds this script usefull and want to use it, please make a fork, or consider creating an issue so that I can version changes properly. If you can see this message means that noone has created an issue, and I assume that I am the only one using it.\n\nThis is a script to backup a git repo, and update it according to the given interval.\n\nIt uses `git clone --mirror` for the initial cloning, and then `git update` for subsequent pulls\n\nThis script needs a config file to work. Create a yaml file and pass it with the arg `--config`, e.g. `--config=../repo` or `--config=/path/repo`.\n\nThe schema of the config file is as follows:\n\n## Examples\n\n### Config\n\n- `auth_token` is optional and is only used when you want to query private repos\n\n```yaml\ninterval: 10\npath: /mnt/storage/git-backup\nrepos:\n  - url: \"git@gitlab.com:halvardm/rust-gitlab.git\"\nowners:\n  - provider: \"github_user\"\n    namespace: \"gituser1\"\n    auth_token: \"ghp_xxxxx\"\n  - provider: \"github_org\"\n    namespace: \"gitorg1\"\n    auth_token: \"ghp_xxxxx\"\n  - provider: \"gitlab_group\"\n    namespace: \"gitgroup1\"\n    auth_token: \"glpat-xxxxx\"\n  - provider: \"gitlab_user\"\n    namespace: \"gituser2\"\n    auth_token: \"glpat-xxxxx\"\n```\n\nWill result in the following file structure\n\n```\n.\n├── github.com\n│   ├── gituser1\n│   │   └── some-repo.git\n│   └── gitorg1\n│       ...\n│       └── some-other-repo.git\n└── gitlab.com\n    ├── gituser2\n    │   └── some-third-repo.git\n    └── gitgroup1\n        ├── gitsubgroup1\n        │   ├── gitsubsubgroup1\n        │   │   └── some-third-level-repo.git\n        │   └── some-second-level-repo.git\n        └── some-top-level-repo.git\n```\n\n### SSH\n\nYou will need to have the SSH key added to the remote where you want to clone from, and to authorize remotes for your local environment.\n\nTo authorize github and gitlab, you can use these scripts, however this is not recommended, and could be considered a security issue.\n\n```shell\nssh-keyscan github.com \u003e\u003e ~/.ssh/known_hosts\nssh-keyscan gitlab.com \u003e\u003e ~/.ssh/known_hosts\n```\n\n### Systemd\n\nIf you use systemd, you can use this template\n\n```\n[Unit]\nDescription=Git backup service\nAfter=network-online.target\n\n[Service]\nType=exec\nExecStart=/bin/git-backup --config=/path/to/config/config.yaml\n\n[Install]\nWantedBy=network-online.target\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalvardssm%2Fgit-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalvardssm%2Fgit-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalvardssm%2Fgit-backup/lists"}