Skip to content

Conversation

@jeffrizzo
Copy link

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.

@ThomasWaldmann
Copy link
Contributor

Interesting, didn't know UF_NODUMP. Seems to be BSD and Linux.

Can you tell more about the use case?
Which tools use it for what precisely?
Does "NODUMP" refer only to the "dump" backup tool or to all backup tools?
Is the check for lchflags function the best way (you do not use that function) or would a check like hasattr(stat, 'UF_NODUMP') be more appropriate?

@jeffrizzo
Copy link
Author

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.

@ThomasWaldmann
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants