https://github.com/flopp/git-repo-backup
Backup a git repository using rsync
https://github.com/flopp/git-repo-backup
Last synced: about 1 year ago
JSON representation
Backup a git repository using rsync
- Host: GitHub
- URL: https://github.com/flopp/git-repo-backup
- Owner: flopp
- License: mit
- Created: 2017-05-26T15:40:41.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-26T19:41:42.000Z (about 9 years ago)
- Last Synced: 2025-01-22T12:24:09.669Z (over 1 year ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-repo-backup
Backup a git repository using rsync
## Usage:
Create incremental snapshots of `/path/to/my/project.git` in `/backup/dir`:
```
$ ./git-repo-backup.sh /path/to/my/project.git /backup/dir
```
If there's a change in `/path/to/my/project.git`, `git-repo-backup.sh` creates an incremental snapshot in `/backup/dir` and updates the symbolic link `project-latest` to point to the latest snapshot:
```
$ ls /backup/dir
project-2017-05-26T19:26:35 # older snapshot
project-2017-05-26T20:15:00 # older snapshot
project-2017-05-26T21:10:00 # latest snapshot
project-latest -> project-2017-05-26T21:10:00 # symbolic link to latest snapshot
project.log # logfile
```
You can call `git-repo-backup.sh` nicely from *cron*, since it checks for changes in the repo before creating a new snapshot.
## Features:
- incremental rsync snapshots -> minimal disk space requirements
- [2-step rsync](https://git.seveas.net/how-to-back-up-a-git-repository.html) -> consistent backups
- change detection -> create snapshots only when repository contains new commits
## Todo
- snapshot rotation
## License
`git-repo-backup` is MIT licensed