Code Monkey home page Code Monkey logo

simple-rsync-backup's Introduction

Simple cross-patform rsync backup

Single-file backup script which lives in the target directory alongside with data and points to actual backup storage.

Backup always simple as invoking ./backup.sh

NOTE: this is mirror-style backup, everything you have deleted in your working copy would be removed on a backup storage during sync (rsync --delete option). It's assumed your are using hard links snapshots on a backup storage if you'd like keep previous files versions.

Few concepts

CONTAINER is a bunch of data which you'd like to keep together, like your documents or photos.

STORAGE is a place on the backup disk/server keeping multiple containers.

By default container name is the current directory name, but you can override it by CONTAINER= option.

Examples

./backup.sh   # perform backup
./backup.sh --verbose   # append custom attributes to rsync

Prerequisites for Server and Client

install rsync-3.1.2+

Install rsync and ssh on Windows

  • Download from http://msys2.org/
  • Follow instructions for update packman
  • Install rsync and ssh
$ pacman -S rsync openssh

Setup ssh config

  • Create ssh key
$ ssh-keygen
  • Create shortcut to backup server in .ssh/config
Host backup-server
  HostName backup.srv
  Port 22
  • Use ssh-copy-id to copy public key to backup server
$ ssh-copy-id user@backup-server

Setup backup config

  • Copy backup-sample.sh into target folder as backup.sh.
  • Open backup.sh and specify correct values for BACKUP_SERVER and STORAGE

Examples:

BACKUP_SERVER="user@backup-server"
STORAGE="family_photos"
  • test in --dry-run (-n) mode
  • remove --dry-run (-n) option by commenting DEBUG= variable

Windows launcher as .sh association

  • copy appropriate 32/64 version of sh_launcher{32/64}.cmd as C:\msys{32/64}\sh_launcher.cmd
  • apply appropriate 32/64 version of msys2_32_sh.reg

Perform backup

  • Run backup.sh
  • Follow instructions

Exclude paths from backup

Create file named backup-ignore. See backup-ignore-sample as reference.

simple-rsync-backup's People

Contributors

x2es avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

simple-rsync-backup's Issues

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.