Can you selectively remove a file from backups?

Is there a way to selectively remove a file from file-based backups?

Scenario: You find a file on a client in plain text that really should be encrypted. This file has been backed up for a while via urbackup file-based backups in plain text. Can you remove all traces of this single file from all existing file-based backups, leaving everything else that was backed up intact?

(I realize that if this plain text file was backed up as part of an image backup, you are screwed)

I assume you know the full path for the file… Which means you could do a search for it under the specific client’s backup folder, and replace it with either an empty file or the correctly encrypted one.

The exact process would depend on the server OS and filesystem.

1 Like

Yeah, with btrfs it is a bit annoying, because it sets the volumes read-only. So you have to set them read-write, remove the file, then set it read-only again.
Idk if it would even work with ZFS snapshots…

Thanks for the replies. I have been out of town, offline, for a while so I apologize for my late acknowledgement of your responses.

Could you clarify for my, if i had Urbackup on Windows and want to granularily delete some files from backups i have to find and delete them in backup folder you mean? Should i run cleanup.bat or cleanup_database.bat or something after? Would backup work correctly after i delete files from it?

Before I go on - general rule is never mess with storage for backup systems like this… That said, it’s your data so here we go :stuck_out_tongue:

You mean the server is Windows? So the storage is NTFS?
If they’re file backups not images, you should be able to search for the offending files and see them. Once you know where they all are, you’ll want to replace them with blank files (or some other safe data if you want a working file there for restore) of the same name. You shouldn’t need to do anything else as long as the files still exist.

I would not recommend this if there are more than a few files or backups, though. You’ll be manually overwriting files in your backups which can be hazardous. If there are more than a few files, or you have entire folders to deal with, it may be difficult to do, and you should consider things like what are the backup policy requirements, how valuable is the good data you may damage in the process, how bad is the bad data in comparison, etc.

General recomendations.

Is there any step by step guide or topic in forum with certain recomendations about my question?

Yes, my URBackup server is installed on Windows Server 2019. And i just want to delete some files (or folders) by name (or by mask whatewer) from all backups to clean space. How can i do it?

Can anyone give solution to me?
I have Urbackup installed in Windows. Is there any way to delete one specific folder with all the files in it FROM ALL BACKUPS?

Without risk, no.

With risk, see the answer above yours.

a) Would it remove the offending backup file by renaming it locally and running a new (incremental) backup?
b) Would it remove the offending backup file to delete prior backups and do a fresh full backup with the file of concern properly encrypted?

after initial posting, I found this from Don_Wright:

Think of each backup as a point-in-time copy of the files at that moment. When UrBackup manages storage by deleting older backups, it will also notice the files that are not needed for later backups (because of changes or deletion since then) and purge the no-longer-needed copies from storage. So yes, things can be lost, but not generally anything currently present on the sets being backed up.

Note also the special case of files that are present on several sets. These will only be deleted after all backups that refer to that version of the file have been deleted. If everyone has the 2021 Policy Manual but April is also keeping the 2019 version she worked on, UrBackup will have to keep both versions in storage, but only one copy of each. The 2020 Manual is no longer saved on any set, so as soon as the last old backup from 2020 is deleted, it will vanish as well.