Skip to content

πŸ“¦πŸš€β˜οΈ Backup multiple Git repos to S3 easily using this Python script with Docker support.

Notifications You must be signed in to change notification settings

pirobtumen/git-backup-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Git Backup to S3 πŸ“¦πŸš€β˜οΈ

Backup multiple Git repositories at once to S3 easily using a Python script with Docker support.

Why

I run my own private Gitlab (on-premise). I want a fully automatic periodic script that creates a security backup of my private projects, but just the source code, so it's fast and cheap.

Features

  • Tested sources: Gitlab, Github.
  • Backup a list of repos at once.
  • Requires HTTPS.
  • The script zips each repo before uploading it to the cloud storage, so it will be cheap.

The script should work with any other source that supports HTTPS.

Docker

docker run --rm \
--env-file=.env \
-v ${PWD}/repos.json:/git-backup-s3/repos.json \
pirobtumen/git-backup-s3

Files .env and repos.json are required. Check the Configuration section.

Configuration

Fill your environment variables inside the .env file:

GIT_USER=
GIT_TOKEN=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_S3_BUCKET=
AWS_REGION=

Create the repos.json file:

[
    "github.com/<user>/<repo>.git",
    "github.com/<user>/<repo>.git",
    "gitlab.com/<user>/<repo>.git",
    "gitlab.com/<user>/<repo>.git",
    ...
]

Resources

Local development

Requires Docker installed.

$ make run

About

πŸ“¦πŸš€β˜οΈ Backup multiple Git repos to S3 easily using this Python script with Docker support.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published