Git Product home page Git Product logo

rsync-snapshots's Introduction

Create a snapshot backup of specified directories/files into remote server via rsync over ssh.

Based on script described here: http://www.pointsoftware.ch/howto-local-and-remote-snapshot-backup-using-rsync-with-hard-links/, but this script give ability to backup local to remote.

PURPOSE

Rsync over ssh is used to transfer the files with a delta-transfer algorithm to transfer only minimal parts of the files and improve speed; rsync uses for this the previous backup as reference. This reference is also used to create hard links instead of files when possible and thus save disk space. If original and reference file have identical content but different timestamps or permissions then no hard link is created. A rotation of all backups renames snapshot.X into snapshot.X+1 and removes backups with X>512. About 10 backups with non-linear distribution are kept in rotation; for example with X=1,2,3,4,8,16,32,64,128,256,512. The snapshots folders are protected read-only against all users including root using 'chattr'.

USAGE

rsync-snapshot.sh [CONFIGURATION_FILE]

If no CONFIGURATION_FILE, local one (default.rshot.conf) will be used.

CONFIGURATION

SNAPSHOT_DST="/home/$USER/backup"           # where to save data on remote server
SSH_HOST="$USER@backupserver"               # remote server address
SSH_PORT="22"                               # remote server ssh port
REMOTE_TMP="/tmp"                           # temporary directory on remote server
INCLUDE_LIST_FILE="./rsync-include.txt"     # incudes directories and files to backup, see man rsync for more info

FILES

rsync-snapshot.sh - the backup script, entry point

rsync-include.txt - rsync filter rules

default.rshot.conf - default example configuration

remove_old.sh, remove_snapshot.sh, rotate_and_clean_up.sh - inner helpers, don't use it directly

rsync-snapshots's People

Contributors

artur-shaik 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.