-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jaakko Salo
committed
Sep 4, 2014
1 parent
68d2620
commit 3a3a32e
Showing
1 changed file
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,38 @@ | ||
zfs_transfer | ||
============ | ||
|
||
Maintain a mirror of ZFS pools over the network | ||
Maintain a mirror of ZFS pools over the network. | ||
|
||
Below is a crontab usage example. Here the various datasets | ||
and snapshots from the host 192.168.1.14 are replicated to our local | ||
ZFS pool, using SSH (-o Compression=no -c arcfour) and caching (mbuffer) | ||
optimizations. | ||
|
||
Parent datasets are automatically created before the initial synch, | ||
when you add a dataset. | ||
|
||
We use 'zfs hold' to implement locking that prevents destruction of | ||
remote snapshots, that would put the synchronization process in danger. | ||
|
||
This allows for laid-back snapshot expiry management on the remote host, | ||
since a lot of force (you need to remove the hold tag) is required to | ||
destroy the latest mutually known snapshot. | ||
|
||
The script should be quite tolerant against various failure conditions. | ||
If you can make it better, please do! | ||
|
||
- by jaakkos, on Fri Sep 5 2014 | ||
|
||
``` | ||
MAILTO="user@host.com" | ||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
0 0 1 * * zpool scrub offsite | ||
# Hostname Remote dataset Local dataset Hold tag Keep days | ||
# m h dom mon dow command ------------ --------------------------------------- -------------------------------------- -------------- ------------ | ||
0 */6 * * * zfs_replicate -h 192.168.1.14 -r backuppool/virt/machines -l offsite/virt/machines -t offsite -k 30 | ||
10 */6 * * * zfs_replicate -h 192.168.1.14 -r backuppool/backuppc -l offsite/backuppc -t offsite -k 30 | ||
20 */6 * * * zfs_replicate -h 192.168.1.14 -r backuppool/timemachine -l offsite/timemachine -t offsite -k 30 | ||
50 */6 * * * zfs_replicate -h 192.168.1.14 -r backuppool/vdp -l offsite/vdp -t offsite -k 30 | ||
``` |