{"id":14069556,"url":"https://github.com/alexadam/repo-backup","last_synced_at":"2025-08-12T22:35:50.336Z","repository":{"id":56853327,"uuid":"279813099","full_name":"alexadam/repo-backup","owner":"alexadam","description":"Backup all Github \u0026 Gitlab repositories as .zip files ","archived":false,"fork":false,"pushed_at":"2020-07-15T12:49:47.000Z","size":810,"stargazers_count":28,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T05:18:03.859Z","etag":null,"topics":["backup","backup-script","backup-solution","backup-tool","backup-utility","backups","bash","bash-script","github","gitlab","project","repository"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/alexadam.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}},"created_at":"2020-07-15T08:36:41.000Z","updated_at":"2025-02-02T07:28:31.000Z","dependencies_parsed_at":"2022-09-21T11:12:17.718Z","dependency_job_id":null,"html_url":"https://github.com/alexadam/repo-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexadam/repo-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexadam%2Frepo-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexadam%2Frepo-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexadam%2Frepo-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexadam%2Frepo-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexadam","download_url":"https://codeload.github.com/alexadam/repo-backup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexadam%2Frepo-backup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270147967,"owners_count":24535690,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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-script","backup-solution","backup-tool","backup-utility","backups","bash","bash-script","github","gitlab","project","repository"],"created_at":"2024-08-13T07:07:02.772Z","updated_at":"2025-08-12T22:35:50.235Z","avatar_url":"https://github.com/alexadam.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# repo-backup\n\nBackup all Github \u0026 Gitlab repositories as .zip files \n\n## Github Backup\n\n### Create an Access Token\n\nOn github.com, go to your profile -\u003e Settings -\u003e Developer Settings -\u003e Personal access tokens\n\nClick on Generate a personal access token \n\n**Name**: *backup* (it doesn't matter)\n**Scopes**: *repo* \u0026 *read:user* \n\nThen click on Generate token\n\n![alt github.png](https://github.com/alexadam/repo-backup/blob/master/screenshots/github.png?raw=true)\n\n### Run the backup script\n\nAfter the token is generated, paste it in the script below:\n\n```sh\n#!/bin/sh\n\ndirname=github-backup-$(date \"+%Y-%m-%d-%H-%M-%S\")\nmkdir \"$dirname\"\ncd $dirname\n\n#change these vars:\nprivateToken=YOUR_ACCESS_TOKEN\nuserName=YOUR_GITHUB_USERNAME\n\ncurl -H \"Accept: application/vnd.github.nebula-preview+json\" \\\n    -H \"Authorization: token $privateToken\" \\\n    \"https://api.github.com/user/repos?visibility=all\u0026affiliation=owner\u0026per_page=200\" \\\n    | jq -r '.[] | .name' \\\n    | while IFS= read projectName; do\n        curl -H \"Authorization: token $privateToken\" -H \"Accept: application/vnd.github.v3.raw\" -L \\\n         \"https://api.github.com/repos/$userName/$projectName/zipball\" --output $projectName.zip\n     done\n\necho Done! All files downloaded here: $(pwd)\n```\n\nThen run the script with `sh github.sh` or `./github.sh` (`chmod +x github.sh` might be needed)\n\n## Gitlab Backup\n\n### Create an Access Token\n\nOn gitlab.com, go to your profile -\u003e Settings -\u003e Access Tokens and create a new Access Token\n\n**Name**: *backup* (it doesn't matter)\n**Expires at**: tomorrow (or later, if you want to reuse it)\n**Scopes**: *read_api* \u0026 *read_repository* \n\nThen click on Create personal access token\n\n![alt gitlab.png](https://github.com/alexadam/repo-backup/blob/master/screenshots/gitlab.png?raw=true)\n\n### Run the backup script\n\nAfter the token is generated, paste it in the script below:\n\n```sh\n#!/bin/sh\n\ndirname=gitlab-backup-$(date \"+%Y-%m-%d-%H-%M-%S\")\nmkdir \"$dirname\"\ncd $dirname\n\nprivateToken=YOUR_ACCESS_TOKEN\nuserName=YOUR_GITLAB_USERNAME\n\ncurl --header \"Private-Token: $privateToken\" \"https://gitlab.com/api/v4/users/$userName/projects\" \\\n   | jq -r '.[] | .id, .name' \\\n   | while IFS= read projectId; read projectName; do\n        curl --header \"Private-Token: $privateToken\" \"https://gitlab.com/api/v4/projects/$projectId/repository/archive.zip\" --output $projectName.zip\n    done\n\necho Done! All files downloaded here: $(pwd)\n```\n\nThen run the script with `sh gitlab.sh` or `./gitlab.sh` (`chmod +x gitlab.sh` might be needed)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexadam%2Frepo-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexadam%2Frepo-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexadam%2Frepo-backup/lists"}