Sign inSign up

istepanov/backup-to-git

By istepanov

Updated over 8 years ago

Docker image for backing up files to a remote git repository

Image
0

2.7K

istepanov/backup-to-git repository overview

istepanov/backup-to-git

Docker Stars Docker Pulls Docker Build Layers

Docker container that periodically backups files to a remote git repository.

Usage
docker run -d [OPTIONS] istepanov/backup-to-git [no-cron]
Required parameters:
  • -e GIT_NAME='Backup User': git user name.
  • -e GIT_EMAIL='[email protected]': git user email.
  • -e GIT_URL=https://username:[email protected]/path: git remote repo.
  • -v /path/to/target/folder:/target:ro: mount target local folder to container's data folder. Content of this folder will be pushed to git repo.
Optional parameters:
  • -e 'CRON_SCHEDULE=0 1 * * *': specifies when cron job starts (details). Default is 0 1 * * * (runs every day at 1:00 am).
  • -e GIT_BRANCH=branch_name: git branch to put commits to (default is 'master').
  • -e GIT_COMMIT_MESSAGE='Custom message': Custom commit message (default is 'Automatic backup').
  • -e TARGET_FOLDER=/target: target folder inside the container (default is '/target').
Commands:
  • no-cron: if specified, run container once and exit (no cron scheduling).
Examples:

Backup changes to git every minute:

docker run -d \
    -v GIT_NAME: 'Backup User' \
    -v GIT_EMAIL: '[email protected]' \
    -v GIT_URL: https://username:[email protected]/username/repo.git
    -v  CRON_SCHEDULE: '* * * * *'
    -v /home/user/data:/target:ro
    istepanov/backup-to-git

Tag summary

Content type

Image

Digest

sha256:2a9236b82

Size

10.5 MB

Last updated

over 8 years ago

docker pull istepanov/backup-to-git