Retain deleted files for x number of days

Hello,

I apologize if this has been answered somewhere else already however I cannot find the answer. I’m using Backblaze B2 (with rclone crypto enabled) as my remote provider, and I want to keep files I’ve deleted on the remote for a limited numbers of days.

So for example if I delete a file on my computer, I do not want rclone to immediately remove it from my Backblaze B2 backup. However after a certain number of days I would like rclone to delete the file. Is this possible? Would I use the rclone copy command (instead of sync), and then somehow issue the rclone delete command to remove the files after x days if they don’t exist at the source?

Also is it possible to have rclone retain multiple file versions for xx number of days? I have turned on the Backblaze bucket lifecycle management to keep prior versions for 90 days. Will rclone work with that?

Thank you!

Paul

This is what the –backup-dir flag is for to move files that got deleted into a new directory. Typically people date these directories and remove them on a schedule.

rclone works out of the box with the b2 lifecycle management. rclone does “soft” deletes by default so it keeps old versions of all the files at b2 until they get deleted.

That is probably the easiest thing to do.

You can use rclone with the --b2-versions flag to see the old versions.

Thank you for the fast response. I tried the --backup-dir argument and receive this error:
“Failed to sync: can’t use --backup-dir on a remote which doesn’t support server side move or copy”

The second part of your response indicates rclone works with b2 lifecycle management, so do I even need to use --backup-dir in my case? Do I only use the --b2-versions flag when retrieving files, or do I need to specify it on my rclone sync command as well?

Thanks again!

Paul

I think I understand how it all works now with Backblaze B2. From what I can tell I don’t need to worry about specifying the --backup-dir argument. I can issue the rclone sync command normally, and file revisions / deletions will be managed by the Backblaze B2 lifecycle management settings.

When reading / restoring from remote, if I include the --b2-versions flag with whatever command I’m using (e.g. rclone mount) it will include file revisions / deletions. If I leave this argument out I will get the most current snapshot that excludes deleted files / revisions.

Is this correct? If so thank you for a great piece of software. I’m able to replace my Crashplan setup with this.

Cheers,
Paul

Sorry forgot about that! Apparently b2 are planning a move or copy object API and rclone will support that when ready.

You don’t need to do anything special - the lifecycle stuff should just work.

Yes all 100% correct!