Repository: borgbackup/borg

Issue:
borg silently refusing to backup folder, but copy of folder works
_borg version 1.0.3 (installed via `brew cask install borgbackup`)
OS: OSX El Capitan 10.11.5
File system: HFS
Hardware: mid-2011 MacBook Air_

I have a folder on my file system which borg refuses to backup. (I noticed this when comparing 

Reducing this to a minimal reproducible integration test with a fresh archive:

```
$ borg init foo
Enter new passphrase:
Enter same passphrase again:
Do you want your passphrase to be displayed for verification? [yN]:

$ borg create --verbose --list --stats --debug foo::1 /path/to/folder
using builtin fallback logging configuration
------------------------------------------------------------------------------
Archive name: 1
Archive fingerprint: 0dedc8df1c6667ec71073e0df03cfd81141c496e8458f12652252ab00938400c
Time (start): Sun, 2016-05-22 14:14:37
Time (end):   Sun, 2016-05-22 14:14:37
Duration: 0.01 seconds
Number of files: 0
------------------------------------------------------------------------------
                       Original size      Compressed size    Deduplicated size
This archive:                  233 B                276 B                276 B
All archives:                  233 B                276 B                276 B

                       Unique chunks         Total chunks
Chunk index:                       1                    1
------------------------------------------------------------------------------

$ borg list foo::1
```

Strangely, creating a copy of the folder works, as borg backs is up:

```
$ cp -r /path/to/folder /path/to/folderCopy
$ borg create --verbose --list --stats --debug foo::2 /path/to/folderCopy
[borg backs up folderCopy]
$ borg list foo::2
[List of files appears]
```

Naturally, my confidence in borg is tarnished, and I'm quite keen on getting to the bottom of this. It's a bit alarming that not even debug mode gives any indication why borg doesn't back up the original folder (BTW, this didn't happen with attic which I used before.)

Any ideas?



Discussion:
File flags? UF_NODUMP would disable backing up a file/directory. Try `ls -lOd <your directory>`[1] to see if flags are set.

[1] http://unix.stackexchange.com/questions/44978/list-all-chflags-file-flags

Spot on, thanks very much! I wasn't aware of `UF_NODUMP`.

```
$ /bin/ls -lOd /path/to/folder{,Copy}
drwx------  18 user  staff  nodump 612 May 22 13:42 /path/to/folder
drwx------  18 user  staff  -      612 May 22 14:08 /path/to/folderCopy
```

As for borg behaviour, would it make sense if borg logs files ignored due to `UF_NODUMP` (at least with `--debug` mode, but maybe also with `--verbose`)? Then it would be clearer to understand why some data is missing in a backup, and make it possible to systematically grep for inadvertently ignored files.

Confidence in borg reinstated, and kudos for the rapid and to-the-point response!

Thanks ;)

Borg shall (but atm doesn't) list files excluded this way as well when using --list


Resolving patch:
diff --git a/borg/archiver.py b/borg/archiver.py
--- a/borg/archiver.py
+++ b/borg/archiver.py
@@ -317,6 +317,7 @@ def _process(self, archive, cache, matcher, exclude_caches, exclude_if_present,
         status = None
         # Ignore if nodump flag is set
         if get_flags(path, st) & stat.UF_NODUMP:
+            self.print_file_status('x', path)
             return
         if stat.S_ISREG(st.st_mode) or read_special and not stat.S_ISDIR(st.st_mode):
             if not dry_run:
diff --git a/borg/testsuite/archiver.py b/borg/testsuite/archiver.py
--- a/borg/testsuite/archiver.py
+++ b/borg/testsuite/archiver.py
@@ -997,14 +997,21 @@ def test_file_status_excluded(self):
         self.create_regular_file('file1', size=1024 * 80)
         os.utime('input/file1', (now - 5, now - 5))  # 5 seconds ago
         self.create_regular_file('file2', size=1024 * 80)
+        if has_lchflags:
+            self.create_regular_file('file3', size=1024 * 80)
+            platform.set_flags(os.path.join(self.input_path, 'file3'), stat.UF_NODUMP)
         self.cmd('init', self.repository_location)
         output = self.cmd('create', '--list', self.repository_location + '::test', 'input')
         self.assert_in("A input/file1", output)
         self.assert_in("A input/file2", output)
+        if has_lchflags:
+            self.assert_in("x input/file3", output)
         # should find second file as excluded
         output = self.cmd('create', '--list', self.repository_location + '::test1', 'input', '--exclude', '*/file2')
         self.assert_in("U input/file1", output)
         self.assert_in("x input/file2", output)
+        if has_lchflags:
+            self.assert_in("x input/file3", output)
 
     def test_create_topical(self):
         now = time.time()


Test patch: