Run tmpreaper every six hours.
Run tmpreaper every six hours and remove files/directories more than 12 hours old. Change-Id: Iba105c7defd950590c6ff437035830e741b9e16a Reviewed-on: https://review.openstack.org/12372 Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
925d13e9ba
commit
4bedff602c
@ -43,4 +43,4 @@ TMPREAPER_PROTECT_EXTRA=''
|
||||
TMPREAPER_DIRS='/tmp/.'
|
||||
TMPREAPER_DELAY='256'
|
||||
TMPREAPER_ADDITIONALOPTIONS='--runtime=600'
|
||||
TMPREAPER_TIME=1d
|
||||
TMPREAPER_TIME=12h
|
||||
|
@ -1,23 +1,33 @@
|
||||
class tmpreaper() {
|
||||
package { 'tmpreaper':
|
||||
ensure => present,
|
||||
}
|
||||
package { 'tmpreaper':
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
file { 'tmpreaper-cron.daily':
|
||||
name => '/etc/cron.daily/tmpreaper',
|
||||
ensure => 'present',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 755,
|
||||
source => 'puppet:///modules/tmpreaper/tmpreaper-cron.daily',
|
||||
}
|
||||
file { '/etc/cron.daily/tmpreaper':
|
||||
ensure => absent
|
||||
}
|
||||
|
||||
file { 'tmpreaper.conf':
|
||||
name => '/etc/tmpreaper.conf',
|
||||
ensure => 'present',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 644,
|
||||
source => 'puppet:///modules/tmpreaper/tmpreaper.conf',
|
||||
}
|
||||
file { '/usr/local/bin/tmpreaper.sh':
|
||||
ensure => 'present',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 755,
|
||||
source => 'puppet:///modules/tmpreaper/tmpreaper.sh',
|
||||
}
|
||||
|
||||
file { '/etc/tmpreaper.conf':
|
||||
ensure => 'present',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 644,
|
||||
source => 'puppet:///modules/tmpreaper/tmpreaper.conf',
|
||||
}
|
||||
|
||||
cron { 'tmpreaper':
|
||||
user => 'root',
|
||||
minute => '42',
|
||||
hour => '*/6',
|
||||
command => 'sleep $((RANDOM\\%60+60)) && /usr/local/bin/tmpreaper.sh',
|
||||
require => File['/usr/local/bin/tmpreaper.sh'],
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user