Docker container that periodically backups files to a remote git repository.
docker run -d [OPTIONS] istepanov/backup-to-git [no-cron]
-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.
-e 'CRON_SCHEDULE=0 1 * * *': specifies when cron job starts (details). Default is0 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').
no-cron: if specified, run container once and exit (no cron scheduling).
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