Automated Git repository backup solution with Alpine Linux and Docker.
1.1K
This solution provides an automated way to back up a Git repository hosted on an Alpine Linux container. The setup involves a Docker container configured with cron jobs to perform daily backups of the specified Git repository. This README outlines the setup process, how to configure your environment, and how to use the backup solution.
dcron to schedule daily backups at midnight by default (ENV variable CRON_SCHEDULE).The docker-compose.yml file facilitates the deployment of the backup solution and, for my personal use, the https://github.com/CanardConfit/livesync-bridge service. Here's an example configuration:
services:
livesync-bridge:
image: canardconfit/livesync-bridge
environment:
TZ: Europe/Zurich
volumes:
- /your/local/path:/livesync-bridge/dat/
- obsidian-volume:/livesync-bridge/obsidian/
git:
image: canardconfit/backup-git
depends_on:
- livesync-bridge
volumes:
- obsidian-volume:/obsidian/
- git-volume:/git-repo/
environment:
TZ: Europe/Zurich
CRON_SCHEDULE: "0 0 * * *"
SOURCE_FOLDER_PATH: "/obsidian/"
COMMIT_MESSAGE_TEMPLATE: "Backup on CURRENT_DATE" # CURRENT_DATE is a placeholder
GIT_REMOTE_URL: "<Your_remote_ssh_git_repo>"
SSH_PRIVATE_KEY: "<Your_Base64_Encoded_SSH_Private_Key>"
volumes:
obsidian-volume:
git-volume:
To run the backup solution, execute:
docker compose up -d
This command starts the containers defined in docker-compose.yml, running the backup operations as configured.
To monitor backup operations, you can check the cron logs within the container:
docker logs <container_name>
We warmly welcome contributions to this project!
This project is released under MPL-2.0.
The MPL-2.0 license allows the mixing of the covered code with other code under different licenses, provided that the MPL-2.0-covered code remains governed by the MPL-2.0 terms.
For more information about the license, please refer to the LICENSE file in the root of this project or visit Mozilla's official MPL 2.0 page.
Content type
Image
Digest
sha256:dd98c0b98…
Size
11.1 MB
Last updated
over 2 years ago
docker pull canardconfit/backup-git