This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
zfs_snapshot_send_receive [2017/08/27 14:07] ian |
zfs_snapshot_send_receive [2020/02/13 22:55] (current) |
||
---|---|---|---|
Line 4: | Line 4: | ||
http:// | http:// | ||
- | |||
- | < | ||
- | < | ||
1. znapzend is installed as a deb package (systemd service) using: https:// | 1. znapzend is installed as a deb package (systemd service) using: https:// | ||
Line 18: | Line 15: | ||
< | < | ||
ssh-keygen | ssh-keygen | ||
- | ssh-copy-id -i / | + | ssh-copy-id -i / |
</ | </ | ||
3. Create the remote ZFS volume to receive the snapshots and delegate permissions to a non-root user. | 3. Create the remote ZFS volume to receive the snapshots and delegate permissions to a non-root user. | ||
+ | |||
+ | < | ||
+ | < | ||
< | < | ||
- | # zfs create data/test | + | destserver: |
+ | </ | ||
- | # zfs allow -u backupuser create, | + | < |
+ | 'zfs allow' does not yet work with ZFS on Linux < 0.7.0 to allow a non-root destination user | ||
- | # zfs allow data/test | + | < |
+ | destserver: | ||
+ | |||
+ | destserver: | ||
---- Permissions on data/test ---------------------------------------- | ---- Permissions on data/test ---------------------------------------- | ||
Local+Descendent permissions: | Local+Descendent permissions: | ||
user backupuser create, | user backupuser create, | ||
</ | </ | ||
+ | </ | ||
3. Create a snapshot schedule consisting of a local SRC schedule, and the remote DST schedule to send the snapshots. | 3. Create a snapshot schedule consisting of a local SRC schedule, and the remote DST schedule to send the snapshots. | ||
Line 39: | Line 45: | ||
Keep snapshots for 1week, with a snapshot every 30 minutes | Keep snapshots for 1week, with a snapshot every 30 minutes | ||
< | < | ||
- | # znapzendzetup create | + | # znapzendzetup create SRC ' |
</ | </ | ||
</ | </ | ||
Line 53: | Line 59: | ||
data/ | data/ | ||
data/ | data/ | ||
- | data/ | + | data/ |
data/ | data/ | ||
data/ | data/ | ||
data/ | data/ | ||
data/ | data/ | ||
- | data/ | + | data/ |
data/ | data/ | ||
data/ | data/ | ||
Line 64: | Line 70: | ||
</ | </ | ||
- | Watch the output of the znapzend daemon: | + | Watch the output of the znapzend daemon |
< | < | ||
:~# journalctl -u znapzend.service -f & | :~# journalctl -u znapzend.service -f & | ||
Line 80: | Line 86: | ||
NAME USED AVAIL REFER MOUNTPOINT | NAME USED AVAIL REFER MOUNTPOINT | ||
data/ | data/ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ~# znapzendztatz -r data/test | ||
+ | USED LAST SNAPSHOT | ||
+ | 85.2K | ||
+ | 0 | ||
+ | </ | ||
+ | |||
+ | 5. You can see how the files and directories looked at snapshot time by accessing the hidden .zfs directory | ||
+ | < | ||
+ | :~# find / | ||
+ | 7 1 -rw-r--r-- | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | destserver: | ||
+ | 7 1 -rw-r--r-- | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | :~# zfs diff data/ | ||
+ | M / | ||
+ | M / | ||
+ | + / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | :~# zfs diff data/ | ||
+ | M / | ||
+ | + / | ||
</ | </ | ||