Skip to content

istepanov/docker-backup-to-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Docker image for backing up files to a remote git repository

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages