plattfot / baksnapper

Script for backing up snapper snapshots
11 stars 5 forks source link

What will happen if the process is interrupted? #19

Open mio-19 opened 9 months ago

mio-19 commented 9 months ago

I previously used btrbk and it provides "btrbk clean" command to clean up interrupted backups. Does baksnapper have a similar thing or how does baksnapper handle interruptions?

plattfot commented 9 months ago

Hi,

Unfortunately that's one thing that baksnapper does not handle well as it relies on btrfs-progs for all the heavy lifting and that does not support cleaning up interrupted snapshots. Instead you need delete snapshots that are invalid by using baksnapper --delete <id>. Not the best solution but I seldom get any interrupts so haven't invested any time to improve on that part.

Looking at the https://github.com/digint/btrbk/blob/master/btrbk#L1573 code and I might be able to do something similar to detect these.

I'm curious why you switched away from btrbk?

mio-19 commented 9 months ago

My network isn't reliable and I often get interrupts :(

I'm curious why you switched away from btrbk?

because I am using snapper

plattfot commented 8 months ago

My network isn't reliable and I often get interrupts :(

Ah, ok. I'll see if I can add some code to handle interrupts better. Not sure on the ETA, but I'll try and poke at it this weekend.

I'm curious why you switched away from btrbk?

because I am using snapper

got it.

mio-19 commented 8 months ago

Looking at the https://github.com/digint/btrbk/blob/master/btrbk#L1573 code and I might be able to do something similar to detect these.

It can be simplified by just checking the ro/rw property of a snapshot.

plattfot commented 8 months ago

Hi, Sorry for the radio silence, life got in the way. Hmm, good point. That shouldn't be that hard to implement. Do you want to implement it? If not I should be able to take some time next week (or this week if you are not following the ISO 8601 standard :nerd_face: )

plattfot commented 8 months ago

Hi, got around to start working on this. You can see the progress for this on #20. I added all the code to clean up interrupted snapshots by testing for read only property. The code isn't tested yet, hence why it is currently a draft.