Giter Site home page Giter Site logo

zsync's Introduction

---- THIS IS A CLONE OF THE ORIGINAL REPOSITORY ON git.bashclub.org ----

zsync

ZFS replication script by Thorsten Spille [email protected]

  • replicates ZFS filesystems/volumes with user parameter bashclub:zsync (or custom name) configured
  • creates optional snapshot before replication (required zfs-auto-znapshot)
  • parameter setting uses zfs hierarchy on source
  • mirrored replication with existing snapshots (filtered by snapshot_filter)
  • pull/local replication only
  • auto creates full path on target pool, enforce com.sun:auto-snapshot=false, inherits mountpoint and sets canmount=noauto
  • raw replication
  • tested on Proxmox VE 7.x/8.x
  • ssh cipher auto selection

Installation

Download and make executable

wget -q --no-cache -O /usr/bin/bashclub-zsync https://git.bashclub.org/bashclub/zsync/raw/branch/dev/bashclub-zsync/usr/bin/bashclub-zsync
chmod +x /usr/bin/bashclub-zsync
bashclub-zsync

Configuration

After first execution adjust the default config file /etc/bashclub/zsync.conf:

# target path on local machine
target=backup/px1

# source host
source=user@host

# source host ssh port
sshport=22

# tag to mark source filesystem
tag=bashclub:zsync

# snapshot name filter
snapshot_filter="hourly|daily|weekly|monthly"

# number of minimum snapshots to keep (per snapshot filter)
min_keep=3

# number of zfs snapshots to keep on source (0 = snapshot function disabled)
zfs_auto_snapshot_keep=0

# make snapshot via zfs-auto-snapshot before replication
zfs_auto_snapshot_label="backup"

Define a cronjob

cron.d example

File: /etc/cron.d/bashclub-zsync

00 23 * * * root /usr/bin/bashclub-zsync -c /etc/bashclub/zsync.conf > /var/log/bashclub-zsync/zsync.log

cron.{hourly|daily|weekly|monthly}

File: /etc/cron.hourly/bashclub-zsync

/usr/bin/bashclub-zsync -c /etc/bashclub/zsync.conf > /var/log/bashclub-zsync/zsync.log

Author

Thorsten Spille

zsync's People

Contributors

spille-edv avatar thorstenspille 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.