Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zbackup: Not possible to omit a single nested filesystem #18

Open
jefft opened this issue Jul 13, 2016 · 1 comment
Open

zbackup: Not possible to omit a single nested filesystem #18

jefft opened this issue Jul 13, 2016 · 1 comment

Comments

@jefft
Copy link

jefft commented Jul 13, 2016

Hi,

With zbackup, it appears to not be possible to backup all filesystems except for a particular one.

Say I have a set of ZFS filesystems:

tank
tank/home
tank/data
tank/var/cache

I'd like to zbackup everything except for 'tank/var/cache'.

Here are my attempts. I have the following zbackup properties:

# zbackup -l
tank daily-snapshots=6 weekly-snapshots=5 replica=backuphost:extbackup replicate=daily

To exclude tank/var/cache, I figured I should unset 'replica' and 'replicate' properties:

# zbackup --unset tank/var/cache replica replicate
zfs inherit com.github.tesujimath.zbackup:replica tank/var/cache
zfs inherit com.github.tesujimath.zbackup:replicate tank/var/cache

But of course that has no effect, because the properties were inherited to begin with.

Let's try setting to a bogus value of 'none':

# zbackup --set tank/var/cache replica=none replicate=none
tank daily-snapshots=6 weekly-snapshots=5 replica=backuphost:extbackup replicate=daily
tank/var/cache replica=none replicate=none

# zbackup -v daily
tank replica=backuphost:extbackup local
tank replicate=daily local
tank daily-snapshots=6 local
tank/var/cache replica=none local
tank/var/cache replicate=none local
========== zsnap -k 6 -p auto-daily- -v tank ==========
.....

No luck, tank/var/cache is still backed up. This is because zbackup's backup_or_reap_snapshots function only considers the 'replica' property of the root ('tank').

I imagine 'fixing' this would be a major endeavour, as it would require making 'zreplicate' aware of ZFS properties (to notice that 'replica' differs halfway down the tree). If so, perhaps this should just be considered a 'known limitation' of an otherwise nicely done tool.

@Rudd-O
Copy link
Owner

Rudd-O commented Aug 12, 2016

Hmm, it should not be that difficult to make zreplicate's algorithm aware of the ZFS properties you mention. The thing is that, as you correctly pointed out, the replica property functionality only considers the property of the source root at this time. This means that the functionality probably needs to be moved into zreplicate proper, such that the zreplicate algoritm that decides what gets replicated can take those properties into account. At the time it does not — it simply computes a difference and elaborates a replication plan based on that difference.

By the way, I would be very happy to review a pull request that helped us get there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants