{"action":"created","issue":{"url":"https://api.github.com/repos/borgbackup/borg/issues/2470","repository_url":"https://api.github.com/repos/borgbackup/borg","labels_url":"https://api.github.com/repos/borgbackup/borg/issues/2470/labels{/name}","comments_url":"https://api.github.com/repos/borgbackup/borg/issues/2470/comments","events_url":"https://api.github.com/repos/borgbackup/borg/issues/2470/events","html_url":"https://github.com/borgbackup/borg/issues/2470","id":225451352,"number":2470,"title":"! /dir/** doesn't exclude anything","user":{"login":"W0nderer","id":25887104,"avatar_url":"https://avatars3.githubusercontent.com/u/25887104?v=3","gravatar_id":"","url":"https://api.github.com/users/W0nderer","html_url":"https://github.com/W0nderer","followers_url":"https://api.github.com/users/W0nderer/followers","following_url":"https://api.github.com/users/W0nderer/following{/other_user}","gists_url":"https://api.github.com/users/W0nderer/gists{/gist_id}","starred_url":"https://api.github.com/users/W0nderer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/W0nderer/subscriptions","organizations_url":"https://api.github.com/users/W0nderer/orgs","repos_url":"https://api.github.com/users/W0nderer/repos","events_url":"https://api.github.com/users/W0nderer/events{/privacy}","received_events_url":"https://api.github.com/users/W0nderer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/borgbackup/borg/milestones/42","html_url":"https://github.com/borgbackup/borg/milestone/42","labels_url":"https://api.github.com/repos/borgbackup/borg/milestones/42/labels","id":2477649,"number":42,"title":"1.1.0b6","description":"","creator":{"login":"ThomasWaldmann","id":356103,"avatar_url":"https://avatars3.githubusercontent.com/u/356103?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasWaldmann","html_url":"https://github.com/ThomasWaldmann","followers_url":"https://api.github.com/users/ThomasWaldmann/followers","following_url":"https://api.github.com/users/ThomasWaldmann/following{/other_user}","gists_url":"https://api.github.com/users/ThomasWaldmann/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasWaldmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasWaldmann/subscriptions","organizations_url":"https://api.github.com/users/ThomasWaldmann/orgs","repos_url":"https://api.github.com/users/ThomasWaldmann/repos","events_url":"https://api.github.com/users/ThomasWaldmann/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasWaldmann/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":18,"state":"open","created_at":"2017-04-24T16:55:27Z","updated_at":"2017-06-03T22:18:10Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2017-05-01T15:09:51Z","updated_at":"2017-06-04T13:43:20Z","closed_at":null,"body":"I have a folder `~/borg-test` containing a file `f0` and directories `d1` and `d2` containing files `f1` and `f2` respectively.  When I created an archive of it using the following patterns file:\r\n```\r\nR /home/me\r\n+ /borg-test\r\n+ /borg-test/d1\r\n! /borg-test/**\r\n```\r\nit included both the directories and all three files.\r\n\r\nIf `!` in Borg works like `-` in `rsync` then it should have included `d1` but no other directories or files.  Using `-` instead of `!` gives the same results.  N.B. `borg help patterns` doesn't mention the `!` prefix yet, or which is the pruning one.\r\n\r\nThis is using the standalone binary borg-linux64 of version 1.1.0b5\r\n\r\nP.S.  The above test was part of an experiment to try to work out how to include all directories in `/var/log` but no files, as raised in issue [#2399,](https://github.com/borgbackup/borg/issues/2399) to which nobody has responded :-( .  It would be much appreciated if someone could tell me how this can be done using Borg filters.\r\n"},"comment":{"url":"https://api.github.com/repos/borgbackup/borg/issues/comments/306040792","html_url":"https://github.com/borgbackup/borg/issues/2470#issuecomment-306040792","issue_url":"https://api.github.com/repos/borgbackup/borg/issues/2470","id":306040792,"user":{"login":"edgimar","id":393850,"avatar_url":"https://avatars3.githubusercontent.com/u/393850?v=3","gravatar_id":"","url":"https://api.github.com/users/edgimar","html_url":"https://github.com/edgimar","followers_url":"https://api.github.com/users/edgimar/followers","following_url":"https://api.github.com/users/edgimar/following{/other_user}","gists_url":"https://api.github.com/users/edgimar/gists{/gist_id}","starred_url":"https://api.github.com/users/edgimar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgimar/subscriptions","organizations_url":"https://api.github.com/users/edgimar/orgs","repos_url":"https://api.github.com/users/edgimar/repos","events_url":"https://api.github.com/users/edgimar/events{/privacy}","received_events_url":"https://api.github.com/users/edgimar/received_events","type":"User","site_admin":false},"created_at":"2017-06-04T13:43:20Z","updated_at":"2017-06-04T13:43:20Z","body":"The behavior looks normal to me:  borg will traverse a directory tree, encountering a directory before it encounters the directory's children.  The pattern `+ /home/me/borg-test` matches `borg-test` and everything beneath it, I believe.  So if that pattern is present, everything matches because that pattern is encountered before the others, and if it is absent, then when borg encounters `borg-test`, it is excluded without recursing due to the `!`, so `d1` is never even considered. "}}
{"actor":{"display_login":"edgimar"}}