From 5930637ded02dae46e92ade97ea6c311b77b1e4c Mon Sep 17 00:00:00 2001 From: "thorsten.spille" Date: Thu, 23 Feb 2023 20:19:11 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index df738d0..94c0658 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,53 @@ # zsync -ZFS replication script by Thorsten Spille -- replicates ZFS filesystems/volumes with user parameter bashclub:zsync configured -- mirrored replication with existing snapshots -- pull replication only -- creates full path on target pool \ No newline at end of file +ZFS replication script by Thorsten Spille +- replicates ZFS filesystems/volumes with user parameter bashclub:zsync configured +- mirrored replication with existing snapshots +- pull replication only +- creates full path on target pool + +## Installation + +#### Download and make executable +~~~ +wget -q --no-cache -O /usr/bin/bashclub-zsync https://git.bashclub.org/bashclub/zsync/raw/branch/main/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 + +# if set to bashclub:zsync=subvol, use inherited only or inherited and received +subvol_source="inherited|received" + +# snapshot name filter +snapshot_filter="hourly|daily|weekly|monthly" +~~~ + +### 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.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.log +~~~ +