Solved Replication Question about -F switch

It is more a understanding question : the man zfs says under zfs send -R
... If the -F flag is specified when this stream is received, snapshots and file systems that do not exist on the sending side are destroyed.
As a non-native speaker I have difficulties to understand, what is destroyed: the snap shot and filesystem on the sending side or on the receiving side ?
As a practical example: I have two zfs filesystems ( send/source & recv/target ) and 6 snapshots named a-f in the following setup
send/source@a
recv/target@b
send/source@crecv/target@c
send/source@d
send/source@e
send/source@f

I do a kind of zfs send -R -I @a send/source@f | zfs recv -F recv/target What will be the result ? Will recv/target@b be deleted or all snapshots on send/source that are not existing on recv/target ?
 
This flag is used on the receiving side and will only destroy things on the receiving side that were already destroyed on the sending side. It makes a lot of sense in backup scripts :)

edit: to further reassure you: zfs send is a read-only operation, only zfs recv will ever write something, and it will only write to the target you give it. A pipe is unidirectional (from the sender to the receiver), so there is no way for a zfs recv to modify anything you send, it can't even know its source.
 
ok, so zfs recv will do an analytics of the received data.It will then identify snapshots that are available on recv/target but have not received from the stream. These identified snapshots will be destroyed on recv/target. In case of the example, it will destroy recv/target@b
So it will clean up the backup from historical data, but is also dangerous if you want to keep the history. It also will not over-write the recv/target@c - I assume the above example will fail with a destination has snapshots error.

I think I need to change my strategy how to name the snapshots. Currently the snapshot names are the weekday names. In a roll-over the snapshot ist converted to a bookmark. The two weeks old bookmarks are deleted. I had hope that the -F switch allows a sort of consolidation on both sides.
 
Back
Top