oetiker / znapzend

zfs backup with remote capabilities and mbuffer integration.
www.znapzend.org
GNU General Public License v3.0
607 stars 137 forks source link

Removable media strategy #467

Closed gabviv73 closed 4 years ago

gabviv73 commented 4 years ago

Hello, daily I want to export mi DST pool to removable media, alternating two disk to be taken offsite. Which is the best strategy to define the removable pools ?

Suggestions ?

Thank you.

oetiker commented 4 years ago

this is not something we actively support in znapzend, but I guess it might work if you just defined two different destinations ... backups would just go to the ones that are available.

nahall commented 4 years ago

I will also say that I do this exact thing right now in SmartOS using restic and borg (I use znapzend for other purposes but not for this so I've never tried using znapzend to do it). I have two USB drives that I actually just named the same pool name as only one is connected at a time and I have a script run every day to back up using restic or borg. I rotate the drives and it works well doing it that way.

gabviv73 commented 4 years ago

this is not something we actively support in znapzend, but I guess it might work if you just defined two different destinations ... backups would just go to the ones that are available.

I tried doing in this way, but SRC snapshots are never cleaned, because DST are never present at the same time So I end up with SRC dataset that contains snapshots that must have been pruned...

oetiker commented 4 years ago

true, source cleaning does get suspended when not all destinations are present ... so you would have to 'reconfigure' in step with you switching the DST devices

gabviv73 commented 4 years ago

Maybe using zfs hold/release` if multiple DST are present.

When creating the snapshot:

    zfs hold DST_1 SRC_POOL/Dataset@YYYY-mm-dd-hhmmss
    zfs hold DST_2 SRC_POOL/Dataset@YYYY-mm-dd-hhmmss

If a hold tag exists, the SRC snapshot cannot be destroyed.

When a successfull transfer to DST occurs, untag the snapshot: zfs release DST_1 SRC_POOL/Dataset@YYYY-mm-dd-hhmmss and zfs release DST_2 SRC_POOL/Dataset@YYYY-mm-dd-hhmmss

So the SRC snapshot can be deleted by policy.