Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

janitor (6) Versions 0.0.5

A General Cookbook used to cleanup files and directories on nodes

Berkshelf/Librarian
Policyfile
Knife
cookbook 'janitor', '= 0.0.5'
cookbook 'janitor', '= 0.0.5', :supermarket
knife cookbook site install janitor
knife cookbook site download janitor
README
Dependencies
Quality

Description

This cookbook is meant to keep order on a running node to purge files on the filesystem that are unwanted. You could also apply some criteria to the files that are targeted such as glob patterns, age, and size.

Requirements

Chef, Linux

Actions

:purge

Purge the files in the directory as either the resource name, or the path attribute to the janitor_directory LWRP Can also apply criteria such age file age, file size

Attributes

No attributes are required for the use of this cookbook

Usage

An LWRP "janitor_directory" is provided for declaring a directory for which to search in and purge files in that directory. Some criteria can also be supplied to include an age and size threshold.

LWRP

janitor_directory

Parameters:

  • path - Resource name or path parameter will pass the path to be examined to the lwrp
  • include_files - Array of glob patterns of files to include in the search criteria
  • exclude_files - Array of glob patterns of files to exclude in the search criteria
  • age - The age in days of files to include in the search criteria
  • size - The size of files to include in the search criteria
  • recursive - enable recursive searching from the path indicated in the resource

Examples

Delete all files in /tmp with the .log extension

janitor_directory "/tmp" do
  include_files ["*.log"]
  action        :purge
end

This will delete all files with the .log extension in /tmp

janitor_directory "/tmp" do
  include_files ["*.log"]
  action        :purge
end

Delete all files in the /var/log directory recursively that are larger than 1 MegaByte

janitor_directory "/var/log" do
  include_files ["*.log"]
  size          "1M"
  recursive     true
  action        :purge
end

Delete all files in the /var/log directory recursively that are older than 5 days

janitor_directory "/var/log" do
  include_files ["*.log"]
  age           5
  recursive     true
  action        :purge
end

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

No quality metric results found