Support hiding instead of deleting for Backblaze B2 backend

Bug #1875529 reported by Thomas Ross
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
duplicity (Ubuntu)
Fix Committed

Bug Description

There should be an option to change the B2 backend to hide instead of deleting files. This can be done by changing this line in B2Backend:

self.bucket.delete_file_version(file_version_info.id_, file_version_info.file_name)

to this:


You can probably also remove the `file_info` call and just use the `path + fsdecode(...)` result, but I don't know enough about the B2 API/duplicity to say that for sure.

Tags: b2 wishlist

Related branches

description: updated
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

I don't see a use case for this. Please explain.

Changed in duplicity:
status: New → Incomplete
Revision history for this message
Thomas Ross (thomas-ross) wrote :

B2 allows two methods of deletion: soft deletion (hiding) and full deletion (deleting). Full deletion is permanent and irrecoverable. Hiding simply creates a new version of the file, saying that the file has been hidden. Additionally, lifecycle rules can be set up on the B2 bucket to full delete hidden files after a certain number of days.

B2 application keys can be restricted to not allow full deletion, and only allow hiding. This means that even if the machine doing the backups is compromised, the backups can only be deleted by the lifecycle rules since the application key on the compromised machine does not have the ability to full-delete the backups.

For my use case, I'd like to be able to restrict the backup machine to only hide and write backups, and have B2 automatically delete hidden (soft deleted) backups after a certain number of days. By replacing the call to delete_file_version with hide_file, duplicity will hide files instead of fully deleting them, allowing them to be restored if required.

Changed in duplicity:
status: Incomplete → New
importance: Undecided → Wishlist
Revision history for this message
Thomas Ross (thomas-ross) wrote :
Changed in duplicity:
assignee: nobody → Kenneth Loafman (kenneth-loafman)
milestone: none → 0.8.13
status: New → In Progress
Changed in duplicity (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
importance: Low → Wishlist
Changed in duplicity:
status: In Progress → Fix Committed
Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
Changed in duplicity:
status: Fix Committed → Fix Released
Changed in duplicity (Ubuntu):
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers