This shows you the differences between two versions of the page.
zfs_snapshot_send_receive [2017/08/27 14:25] ian |
zfs_snapshot_send_receive [2020/02/13 22:55] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== ZFS Snapshot Send/ | ||
- | |||
- | Local ZFS snapshots are uploaded to a remote server (backup) over SSH, using the utility znapzend to manage the snapshot schedule. | ||
- | |||
- | http:// | ||
- | |||
- | 1. znapzend is installed as a deb package (systemd service) using: https:// | ||
- | |||
- | 2. Create a shared key for SSH to allow password-less login from source to dest server as the receiver backupuser | ||
- | |||
- | < | ||
- | Do not specify a password on the shared key, just press enter when prompted. | ||
- | </ | ||
- | |||
- | < | ||
- | ssh-keygen | ||
- | ssh-copy-id -i / | ||
- | </ | ||
- | |||
- | 3. Create the remote ZFS volume to receive the snapshots and delegate permissions to a non-root user. | ||
- | |||
- | < | ||
- | < | ||
- | |||
- | < | ||
- | # zfs create data/test | ||
- | |||
- | # zfs allow -u backupuser create, | ||
- | |||
- | # zfs allow data/test | ||
- | ---- Permissions on data/test ---------------------------------------- | ||
- | Local+Descendent permissions: | ||
- | user backupuser create, | ||
- | </ | ||
- | |||
- | 3. Create a snapshot schedule consisting of a local SRC schedule, and the remote DST schedule to send the snapshots. | ||
- | |||
- | < | ||
- | Keep snapshots for 1week, with a snapshot every 30 minutes | ||
- | < | ||
- | # znapzendzetup create --recursive SRC ' | ||
- | </ | ||
- | </ | ||
- | |||
- | Reload the config of the znapzend daemon | ||
- | < | ||
- | # systemctl reload znapzend.service | ||
- | </ | ||
- | |||
- | 4. The backup schedule is saved as ZFS volume properties | ||
- | < | ||
- | # zfs get all data/test | grep org.znapzend | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | data/ | ||
- | </ | ||
- | |||
- | Watch the output of the znapzend daemon for any errors: | ||
- | < | ||
- | :~# journalctl -u znapzend.service -f & | ||
- | </ | ||
- | |||
- | Watch for local snapshots to be created: | ||
- | < | ||
- | # zfs list -t snap | ||
- | NAME | ||
- | data/ | ||
- | </ | ||
- | |||
- | < | ||
- | destserver: | ||
- | NAME USED AVAIL REFER MOUNTPOINT | ||
- | data/ | ||
- | </ | ||
- | |||
- | < | ||
- | ~# znapzendztatz -r data/test | ||
- | USED LAST SNAPSHOT | ||
- | 85.2K | ||
- | 0 | ||
- | </ | ||