Defined Type: graphite::whisper_cleanup

Defined in:
modules/graphite/manifests/whisper_cleanup.pp

Overview

Parameters:

  • directory (Any)
  • keep_days (Any) (defaults to: 30)
  • user (Any) (defaults to: '_graphite')


9
10
11
12
13
14
15
16
17
18
19
20
# File 'modules/graphite/manifests/whisper_cleanup.pp', line 9

define graphite::whisper_cleanup (
  $directory,
  $keep_days = 30,
  $user = '_graphite',
) {
    cron { $title:
        command => "[ -d ${directory} ] && find ${directory} -type f -mtime +${keep_days} -delete && find ${directory} -type d -empty -delete",
        user    => $user,
        hour    => fqdn_rand(24, $title),
        minute  => fqdn_rand(60, $title),
    }
}