digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.64k stars 120 forks source link

Is it possible to easily identify snapshots that are identical? #462

Open korg opened 2 years ago

korg commented 2 years ago

I guess this is more a btrfs question, probably to do with generation, but if i have a list of backups, is there an easy way to identify which are identical to the previous one? Ie, no changes since last backup.

I was just thinking it might be nice for btrbk to be able to identify those identical backups, if it wasnt too disk intensive to do.

This might be pre-btrfs level thinking on my part because i guess if they are identical they should not be using any disk space.

PrplHaz4 commented 2 years ago

I would love to have an easy way to delete all snapshots that have no changes - it would make my daily snapshots directory a lot more useful and easy to scan for a human.

Micha-Btz commented 2 years ago

I think btrbk has an mechanisms to identify if the source subvolume has changed or not.

Take a look on create snapshot "onchange" in the doc. So identically snapshots will not be created.

PrplHaz4 commented 2 years ago

I think btrbk has an mechanisms to identify if the source subvolume has changed or not.

Take a look on create snapshot "onchange" in the doc. So identically snapshots will not be created.

Thanks!

snapshot_create always|onchange|ondemand|no

If set to “always”, snapshots are always created. If set to “onchange”, snapshots are only created if the last snapshot is not up-to-date, i.e. the source subvolume has changed (more precisely: the btrfs generation has been increased) since the last snapshot was created. If set to “ondemand”, snapshots are only created if at least one target subvolume is reachable (useful if you are tight on disk space and you only need btrbk for backups to an external disk which is not always connected). If set to “no”, the snapshots are never created (useful if another instance of btrbk is taking care of snapshot creation). Defaults to “always”. ref: https://digint.ch/btrbk/doc/btrbk.conf.5.html

digint commented 2 years ago

For the subvolumes that are already created, try btrbk extents diff. If no extents differ, the subvolumes should be identical.