Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9514

tidy: Allow removal of old directories, even if not empty

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Accepted
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Coremunity
    • QA Risk Assessment:
      Needs Assessment

      Description

      The tidy resource currently doesn't allow removal of non-empty directories. But sometimes this is exactly what is needed. For example we have a Windows application which doesn't cleanup after itself and leaves behind lots of directories with name "out-*" which I would like to remove after some days. Unfortunately, those directories are written to the root of drive D:, alongside other directories, which ought to be kept (but shouldn't need to be traversed).

      So the approach I'd like to use is:

      tidy { 'cleanup_d':
        path =>  'D:/',
        matches => ['out-*'],
        age => '7d',
        recurse => 1,
        rmdirs => true,
      }

      but this apparently doesn't work because the directories aren't empty.

      Please add a "force" property to allow removal of non-empty directories.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            dhs@recommind.com Dirk Heinrichs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support