On Thursday, October 11, 2012 5:07:36 PM UTC-5, Ygor wrote:
>
> Either puppet-resource-type "tidy" is busted or I do not properly
> understand its use.
>
> Red Had Enterprise Linux 5.8 server (x86_64)
> I am seeing this behavior on both Puppet 2.6.17 and 2.7.19
>
> I want to "tidy" up a path -- let's say /volume/foo/bar/ (bar is a
> directory)
>
> The resource definition is:
>
> tidy { '/volume/foo/bar/':
> age => '0',
> recurse => true,
> rmdirs => true,
> }
>
> To test it, I do the following
>
> cd /volume/foo/bar/
> mkdir 1 2 3 4 5 6
> touch 1/a 2/b 3/c 4/d 5/e 6/f 6/g
>
> then I run puppet.
> It deletes all the "touched" files (a, b, c, d, e, f, g)
>
> Now for The Problem:
> When I run puppet again, I am expecting the empty directories ( 1/ 2/ 3/
> 4/ 5/ 6/ ) to get deleted.
> They are not removed. Even though the "rmdirs" parameter is set to true.
>
> Is this the way "tidy" is supposed to work ?
>
>
That behavior is not consistent with my reading of the docs. There is
definitely a bug there. I speculate that it might be related to the fact
that recursing the subdirectories necessarily updates their atimes, which
is what 'tidy' looks at by default to compute an age. It still should work
even then, however, because it should not be possible that way to produce
an age less than zero. You should file a ticket.
You could try to work around it by setting a negative 'age' parameter and /
or by changing the 'type' to 'mtime' (last modification time) or even
'ctime' (creation time). Note that using 'mtime' might have similar
implications for nonempty directories as 'atime' may have for empty ones
(removing contents should update directory mtimes, possibly producing an
issue with 'age') but at least you would then expect the then-empty
directories to be cleaned up on the next Puppet run.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/MVadY2TnyqcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.