Remove files with Puppet

If you need to remove old, large or unused files and directories by Puppet.

8

Votes

class tidy_cache {

  # Always remove the given file
  tidy { '/tmp/install-artifact': }

  # remove all files from /tmp/dropbox
  tidy { 'clean_dropbox':
    path    => '/tmp/dropbox',
    recurse => 1,
  }

  # remove all files, in /tmp/image_cache,
  # that are older than 1 week
  tidy { 'prune_old_caches':
    path    => '/tmp/image_cache',
    age     => '1w',
    recurse => 1,
  }

}

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote

Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

Advertise

DevOpsnipp.com © 2020

medium.png