Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

b2: on cleanup delete hide marker if it is the current file #604

Nick Craig-Woodb4f2ada82065
diff --git a/b2/b2.go b/b2/b2.go
index 192757943..05cf0e8b3 100644
--- a/b2/b2.go
+++ b/b2/b2.go
@@ -800,7 +800,12 @@ func (f *Fs) purge(oldOnly bool) error {
if !isDirectory {
fs.Stats.Checking(remote)
if oldOnly && last != remote {
- fs.Debug(remote, "Not deleting current version (id %q) %q", object.ID, object.Action)
+ if object.Action == "hide" {
+ fs.Debug(remote, "Deleting current version (id %q) as it is a hide marker", object.ID)
+ toBeDeleted <- object
+ } else {
+ fs.Debug(remote, "Not deleting current version (id %q) %q", object.ID, object.Action)
+ }
} else {
fs.Debug(remote, "Deleting (id %q)", object.ID)
toBeDeleted <- object