Giter Site home page Giter Site logo

coresolutiondoteu / rsync-time-backup_fork Goto Github PK

View Code? Open in Web Editor NEW

This project forked from panta/rsync-time-backup

0.0 0.0 0.0 13 KB

Docker image for Time Machine like backups using rsync, wrapping the excellent rsync_tmbackup.sh script.

License: Apache License 2.0

Dockerfile 6.01% Makefile 2.62% Shell 91.37%

rsync-time-backup_fork's Introduction

rsync-time-backup

Docker image wrapping the excellent rsync_tmbackup.sh script.

To paraphrase the original script README, this image offers Time Machine-style backup using rsync. It creates incremental backups of files and directories to the destination of your choice. The backups are structured in a way that makes it easy to recover any file at any point in time.

Being a docker image, it can run almost anywhere: on a Linux, macOS or Windows machine or on most NAS supporting virtualization.

Configuration

A few environment variables allow you to customize the behavior of the backup:

  • RSYNCTM_SRC source location for backup command
  • RSYNCTM_DST destination location for backup command
  • RSYNCTM_STRATEGY backup strategy (see rsync_tmbackup.sh docs, defaults to 1:1 30:7 365:30)
  • RSYNCTM_LOG_DIR directory for backup logs
  • RSYNCTM_ID_RSA ssh key file path
  • RSYNCTM_PORT remote port for rsync
  • CRON crontab schedule 0 0 * * * to perform sync every midnight
  • CRON_ABORT crontab schedule 0 6 * * * to abort sync at 6am
  • FORCE_BACKUP set variable to perform a backup upon boot
  • CHECK_URL healthchecks.io url or similar cron monitoring to perform a GET after a successful sync
  • TZ set the timezone to use for the cron and log

Usage

$ DEST=/path/to/destination
$ mkdir -p $DEST
$ touch $DEST/backup.marker
$ docker run --rm -it \
    -v $HOME/.ssh/id_rsa:/id_rsa \
    -v $DEST:/backups \
    -e RSYNCTM_SRC="user@remote:/source/path" \
    -e RSYNCTM_DST="$DEST" \
    -e RSYNCTM_ID_RSA="/id_ssh" \
    -e RSYNCTM_STRATEGY="1:1 30:7 365:30" \
    -e TZ="Europe/Rome" \
    -e CRON="0 0 * * *" \
    -e CRON_ABORT="0 6 * * *" \
    -e FORCE_BACKUP=1 \
    panta/rsync-time-backup:latest

See also the example script at sample-usage.sh:

$ REMOTE_SRC="user@remote:/source/path" SSH_KEY="$HOME/.ssh/my_ssh_key" ./sample-usage.sh

License

This software is released under the Apache License 2.0.

References

rsync-time-backup_fork's People

Contributors

panta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.