Re: star and /dev/watchdog (exclusion of files)

Wolfram Schlich <[email protected]> Fri, 14 Mar 2008 14:20:50 +0100
Newsgroups gmane.comp.archivers.star.user
Organization Axis of Weasel(s)
Message-ID <[email protected]>
* Joerg Schilling <[email protected]> [2008-03-14 11:31]:
> Wolfram Schlich <[email protected]> wrote:
> 
> > Hi,
> >
> > some time ago (I don't remember the version of star I was using back
> > then) I stumbled over an issue regarding the exclusion of files from
> > being backed up by star.
> >
> > I am using the following command line arguments to exclude files from
> > the backup:
> >
> > 	-not pattern='^/some/path/here/{%!/*}'
> >
> > This excludes everything *beyond* /some/path/here (the path itself
> > is being backed up, but empty).
> 
> What you create here are two patterns:
> 
> /some/path/here/%	(where % refers to an empty string)
> and
> /some/path/here//*
> 
> What do you expect from the double slash?

Sorry, I had a mistyping in there -- I was really using this:

	-not pattern='^/some/path/here{%!/*}'

So it expands to:

	/some/path/here
	/some/path/here/*

> The pattern "/some/path/here/*" would include "/some/path/here/" and any
> nonempty replacement for "*". Is this not what you intend?

And I was wrong -- it does not include the directory itself as empty.
Forget about that. Here comes the point:

The problem I had was that with -not -pattern='/some/dir', it did exclude
/some/dir *itself*, but not anything *beyond* /some/dir (for example
/some/dir/somefile). So, in order to *completely* exclude a directory,
I have to use '^/some/dir{%!/*}'.
As opposed to GNU tar which handles --exclude=/some/dir just as I'd
expect it.

> > So far, so good. Back then I tried this to exclude /dev/* like this:
> >
> > 	-not pattern='^/dev/{%!/*}'
> >
> > The problem with this was that star did in some way fiddle with the
> > files beyond /dev/ -- the watchdog came alive because star somehow
> > touched/opened it and thus it resetted the machine after the
> > write-timeout expired (no write to the watchdog device after N
> > seconds) :(
> > Is there a way to *safely* exclude everything *beyond* a given
> > directory but not the directory itself? By 'safely' I mean making
> > star NOT touch anything beyond at all.
> 
> If this is on Linux, you basically are a victim of bad Linux kernel interface 
> definitions. See e.g. the paragraph for -xfflags in the section NOTES of the
> star man page. Do you use -xfflags?

Yes.

> In general: star (the upper layer) does not understand the patterns and for 
> this reason cannot know whether a pattern that excludes a directory _also_ 
> excludes all files under that directory. For this reason, star still scans the 
> whole directory tree. Star however will only _open(2)_ _directories_ for this
> purpose except when you are on Linux and you did specify -xfflags.

Hmm. Looks like a design limitation. GNU tar does not have that
problem, for example (it does not scan the whole tree).

> If you hit a driver with side-effects on open(2) (like a tape driver that 
> rewinds on open(2) or close(2)), you are lost on Linux. If a driver does not 
> honor O_NDELAY, other problems may occur.
> 
> Where is your problem?

Looks like I missed the NOTES section about -xfflags :)
I'll switch off -xfflags now.

Thanks!
-- 
Wolfram Schlich