diff --git a/mirror/manifests/init.pp b/mirror/manifests/init.pp index 0f49eee..4b07db9 100644 --- a/mirror/manifests/init.pp +++ b/mirror/manifests/init.pp @@ -79,6 +79,18 @@ class mirror($datadir="/srv/mirrors", $cron=true) { require => [ File["/usr/local/bin/sync-mirrors"], User["mirror"], ], } + cron { "sync-mirrors-logs": + ensure => $cron ? { + false => absent, + default => present, + }, + command => "find /var/log/sync-mirrors/ -xdev -type f -mtime +30 -name '*.log' -execdir rm {} \+", + user => "mirror", + hour => 1, + minute => 10, + require => [ File["/var/log/sync-mirrors"], User["mirror"], ], + } + }