# zfSnap send



## graudeejs (Nov 25, 2010)

I've received another email about my sysutils/zfSnap script. The person would like zfSnap to have some kind of send snapshot abilities...

I have to admit, that I have thought about this myself...

So the question would be:
* How many other users would like to have this functionality, and how would you expect zfSnap to send snapshots?

If you think it's pointless, and would make script bloated, I'd like to hear that...
Maybe I should write zfSend?


Thanks in advance for your feedback.


----------



## Gusi (Nov 26, 2010)

Well, I was thinking about zfs send myself. My servers are backing up via zfs snapshot + custom incremental rsyncs. Using zfs send would a first approach, but what I think would a killing app is incremental zfs sends. But I don't know if that would be easy to implement with sh or it would be overkill. 

Any help I may provide, let me know.


----------



## phoenix (Nov 26, 2010)

zfs(8), read the section on *send*, it includes a description of incremental sending of snapshots.


----------



## carlton_draught (Dec 10, 2010)

You might want to check out my new script zxfer, which is a fork of Constantin Gonzalez's zfs-replicate. I wrote it in email collaboration with Constantin.

I think you will find that it is just what you are looking for. I've put a lot of work into it. I've made a thread on it here.


----------



## carlton_draught (Dec 10, 2010)

Gusi said:
			
		

> Well, I was thinking about zfs send myself. My servers are backing up via zfs snapshot + custom incremental rsyncs. Using zfs send would a first approach, but what I think would a killing app is incremental zfs sends. But I don't know if that would be easy to implement with sh or it would be overkill.
> 
> Any help I may provide, let me know.


If you want to test the script, have a go. I've tested it enough that I am satisfied it is working well enough for me. 

I've written documentation on how to backup, restore a ZFS root mirror setup that has regular snapshotting via zfs-snapshot-mgmt. After I figure out how to update world and kernel properly, I'll incorporate it into the documentation and release it. So then everyone will be able to have a highly reliable workstation or server, able to easily back it up, easily restore it, and hopefully never lose more data than the delta between the last off-site backup. And hopefully other people can notify me of any errors I've made.


----------



## graudeejs (Dec 11, 2010)

Thanks, I will have to take a look at it in 2 weeks (when I'll have some holidays at last)


----------



## carlton_draught (Dec 11, 2010)

killasmurf86 said:
			
		

> Thanks, I will have to take a look at it in 2 weeks (when I'll have some holidays at last)


No problem. If you should want to get using it any sooner than that, I am happy to guide you through how to use it. Pretty much all you have to do is copy the script and man page to the correct locations and run it with a given command for what you want to transfer (backup or restore).

For example, to backup my storage/home filesystem, I use the following command:
`# zxfer -bdFkPv -o copies=2,compression=lzjb -N storage/home backup07/filesystems`
What this does:

-b: beep when done
-d: delete snapshots on destination that are absent on source (this will happen when you use a snapshotting regime with auto delete, and is necessary for zfs send/receive to work)
-F: force rollback of destination to the last snapshot. Necessary to get zfs send/receive to work most of the time.
-k:  Write a backup file storing the original properties and sources of storage/home that will be stored in the /backup07/filesystems directory
-P: transfer properties (and their sources) of storage/home to backup07/filesystems/home
-v: verbose mode
-o copies=2,compression=lzjb: since it's a backup, we want to have 2 copies to guard against everything bar a head crash, and compression to mitigate some of the extra space required by copies=2. This overrides the destination properties, but since we have written a backup file we can restore those properties without having to do it by hand.
-N storage/home: just transfer storage/home, do not recurse into any sub-fileystems
backup07/filesystems: this is the destination

Basically, I have this in a script and whenever I want to backup to a HDD, I just whack the HDD into the dock and it couldn't be easier.


----------

