Conversation
|
Interesting, didn't know UF_NODUMP. Seems to be BSD and Linux. Can you tell more about the use case? |
|
BSD and MacOS - AFAICT Linux doesn't have it. (I assume that was probably just a typo) Use case is to easily mark files which are not to be backed up - usually done on a scratch partition or something. Yes, it can be done with an --exclude flag, but I find sometimes that info is better as metadata on the file system itself. Most backup tools from the BSD world honor it either by default (dump) or with a flag (--nodump for tar meaning "skip files with the nodump file set"). tarsnap (a commercial product, whose dedup looks a lot like attic's, also supports it with a flag). I could reimplement it with a flag; do you have a preference? (--nodump is what tar uses, but I'm not picky) Re: the correct attr to check for; lchflags() is what the other file checks for, and flags (like UF_NODUMP) are not available if chflags/lchflags aren't. What I really want to check for is that the stat structure has st_flags; not sure if that's possible. |
|
I don't have os.lchflags on linux and there is no st_flags in stat_result (but I have UF_NODUMP in stat), so looks like your check is appropriate. I'ld be fine with --nodump, but better ask @jborg. |
On BSD systems (NetBSD, FreeBSD, MacOS) the "nodump" flag should cause files to not be backed up. This change implements that.
Tested on NetBSD 6.1 and Ubuntu.