{"action":"created","issue":{"url":"https://api.github.com/repos/borgbackup/borg/issues/70","labels_url":"https://api.github.com/repos/borgbackup/borg/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/borgbackup/borg/issues/70/comments","events_url":"https://api.github.com/repos/borgbackup/borg/issues/70/events","html_url":"https://github.com/borgbackup/borg/issues/70","id":91496618,"number":70,"title":"Thoughts on \"delete\" for files/directories?","user":{"login":"jumper444","id":1995883,"avatar_url":"https://avatars.githubusercontent.com/u/1995883?v=3","gravatar_id":"","url":"https://api.github.com/users/jumper444","html_url":"https://github.com/jumper444","followers_url":"https://api.github.com/users/jumper444/followers","following_url":"https://api.github.com/users/jumper444/following{/other_user}","gists_url":"https://api.github.com/users/jumper444/gists{/gist_id}","starred_url":"https://api.github.com/users/jumper444/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jumper444/subscriptions","organizations_url":"https://api.github.com/users/jumper444/orgs","repos_url":"https://api.github.com/users/jumper444/repos","events_url":"https://api.github.com/users/jumper444/events{/privacy}","received_events_url":"https://api.github.com/users/jumper444/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-27T17:57:03Z","updated_at":"2015-06-29T14:53:34Z","closed_at":null,"body":"What are the thoughts on allowing the delete of specific files or entire directories WITHIN a repository or archive?\r\n\r\nSuch as...delete all the *.tmp files in aprilBackup:\r\n\"borg delete myRepository::aprilBackup -p \"*.tmp\"\r\n(-p = pattern or delete pattern file or such; don't know what exact notation would be)\r\n\r\nRemove the tmp files in entire repository:\r\n\"borg delete myRepository -p \"*.tmp\"\r\netc...etc...etc....\r\n\r\nYes, I'm aware that you should ideally *exclude* putting files into the repository in the *first* place, but that is definitely not always possible or known.  There are many instances where you might later realize significant files that have been backed up, are not wanted, and (most importantly) are HIGHLY non-dedupable.  You want to pull those out with a pattern and shrink your repository without removing entire archives.\r\n\r\n(I've run across this in practice by backing up multiple FirefoxPortable instances.  Obviously you exclude the CACHE, but what wasn't known immediately is that there are numerous other files that are essentially cache or temp in nature while not so names.  These are also hard to dedup and large in size.  Now that I know what they are I'd love to wipe them out of the repository, but can't easily.)\r\n\r\nThis then brings me to a second feature which would be diagnostic in nature and actually allow the finding, programatically, of these 'dedupe hotspots' in multiple backups.  I've never seen such a thing in practice and will post it as \"issue\" immediately following this one for separate discussion. (But the finding of such hotspots is useless if a user can't \"delete\" individual data in a repository or backup.)"},"comment":{"url":"https://api.github.com/repos/borgbackup/borg/issues/comments/116715773","html_url":"https://github.com/borgbackup/borg/issues/70#issuecomment-116715773","issue_url":"https://api.github.com/repos/borgbackup/borg/issues/70","id":116715773,"user":{"login":"jumper444","id":1995883,"avatar_url":"https://avatars.githubusercontent.com/u/1995883?v=3","gravatar_id":"","url":"https://api.github.com/users/jumper444","html_url":"https://github.com/jumper444","followers_url":"https://api.github.com/users/jumper444/followers","following_url":"https://api.github.com/users/jumper444/following{/other_user}","gists_url":"https://api.github.com/users/jumper444/gists{/gist_id}","starred_url":"https://api.github.com/users/jumper444/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jumper444/subscriptions","organizations_url":"https://api.github.com/users/jumper444/orgs","repos_url":"https://api.github.com/users/jumper444/repos","events_url":"https://api.github.com/users/jumper444/events{/privacy}","received_events_url":"https://api.github.com/users/jumper444/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T14:53:33Z","updated_at":"2015-06-29T14:53:33Z","body":"The ability to delete anything on a computer has simple known risks.  They are what they are, but programs, filesystems, or databases or whatever don't remove the command just because it could go wrong or be misused.  The common solution for most utlities I've seen is a 'no action' or 'list changes only' command line switch.  For robocopy on windows it is \"/L\" meaning list all changes you will do with this exec, but don't actually do anything.  You run with \"/L\", review and make sure your wildcards, or regex, or whatever are hitting what you expect.  Then remove the switch and make it permanant.\r\n\r\nI presume when removing an archive Borg looks it up, get's a list of contained files, then issues a separate delete call per file.  This new concept just creates the list separately from 'exclude file' type patterns which are already programmed instead of the archive record.\r\n\r\nI see value for the feature and I see similar commands on most other utilities that operate on data/file batches.  Waiting on a prune (which I currently don't do) isn't really the same thing.  Even still I would only prune things after years (based on various legal requirements of financial/business data).\r\n\r\nThe file/directory delete allows efficient cleanup of either 'nondedupable hotspots' found post backup or removal of whole segments of data which clearly are now not needed without disturbing the remainder of an archive which might be needed for years."}}