User Tools

Site Tools


zfs_snapshot_send_receive

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

zfs_snapshot_send_receive [2017/08/27 14:04]
ian
zfs_snapshot_send_receive [2020/02/13 22:55]
Line 1: Line 1:
-====== ZFS Snapshot Send/Receive ====== 
- 
-Local ZFS snapshots are uploaded to a remote server (backup) over SSH, using the utility znapzend to manage the snapshot schedule. 
- 
-http://www.znapzend.org/ 
- 
-<note>The ZFS volume of the given name must exist on the remote node 
-<code>*** WARNING: destination 'root@destserver:data/test' does not exist, will be ignored! ***</code></note> 
- 
-1. znapzend is installed as a deb package (systemd service) using: https://github.com/Gregy/znapzend-debian 
- 
-2. Create a shared key for SSH to allow password-less login from source to dest server as the receiver backupuser 
- 
-<note> 
-Do not specify a password on the shared key, just press enter when prompted. 
-</note> 
- 
-<code> 
-ssh-keygen 
-ssh-copy-id -i /root/.ssh/id_rsa.pub backup@desterver 
-</code> 
- 
-3. Create the remote ZFS volume to receive the snapshots and delegate permissions to a non-root user. 
- 
-<code> 
-# zfs create data/test 
- 
-# zfs allow -u backupuser create,receive,rename,mount,send data/test 
- 
-# zfs allow data/test 
----- Permissions on data/test ---------------------------------------- 
-Local+Descendent permissions: 
-        user backupuser create,mount,receive,rename,send 
-</code> 
- 
-3. Create a snapshot schedule consisting of a local SRC schedule, and the remote DST schedule to send the snapshots. 
- 
-<note> 
-Keep snapshots for 1week, with a snapshot every 30 minutes 
-<code> 
-# znapzendzetup create --recursive SRC '1week=>30min' data/test DST '1week=>30min' backupuser@destserver:data/test 
-</code> 
-</note> 
- 
-Reload the config of the znapzend daemon 
-<code> 
-# systemctl reload znapzend.service 
-</code> 
- 
-4. The backup schedule is saved as ZFS volume properties 
-<code> 
-# zfs get all data/test | grep org.znapzend 
-data/test  org.znapzend:tsformat       %Y-%m-%d-%H%M%S                         local 
-data/test  org.znapzend:pre_znap_cmd   off                                     local 
-data/test  org.znapzend:dst_0          backupuser@destserver:data/test  local 
-data/test  org.znapzend:mbuffer        off                                     local 
-data/test  org.znapzend:dst_0_plan     1weeks=>30minutes                       local 
-data/test  org.znapzend:enabled        on                                      local 
-data/test  org.znapzend:zend_delay                                           local 
-data/test  org.znapzend:recursive      on                                      local 
-data/test  org.znapzend:mbuffer_size   1G                                      local 
-data/test  org.znapzend:post_znap_cmd  off                                     local 
-data/test  org.znapzend:src_plan       1weeks=>30minutes                       local 
-</code> 
- 
-Watch the output of the znapzend daemon: 
-<code> 
-:~# journalctl -u znapzend.service -f & 
-</code> 
- 
-Watch for local snapshots to be created: 
-<code> 
-# zfs list -t snap 
-NAME                                 USED  AVAIL  REFER  MOUNTPOINT 
-data/test@2017-08-27-100000                  -   128K  - 
-data/test@2017-08-27-103000                  -   128K  - 
-</code> 
  
zfs_snapshot_send_receive.txt ยท Last modified: 2020/02/13 22:55 (external edit)

free spam filter