puppet: Merged puppet-report-cleanup from parameterize branch.
This commit is contained in:
parent
766f7d06a5
commit
3cf4363186
2 changed files with 35 additions and 15 deletions
|
@ -1,6 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
MAXAGE=<%= @puppet_report_maxage %>
|
||||
if [ "`whoami`" = "root" ]; then
|
||||
echo "$0: must not be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/usr/sbin/tmpwatch -m ${MAXAGE} /srv/puppet/reports
|
||||
find /srv/puppet/reports/ -mindepth 2 -mmin +1440 -type f -name \*.yaml -exec gzip {} \;
|
||||
find /srv/puppet/reports/ -xdev -mindepth 2 -type f -mtime +<%= @puppet_report_maxage %> \
|
||||
-name '*.yaml.gz' -execdir rm -f -- {} \;
|
||||
find /srv/puppet/reports/ -xdev -mindepth 2 -type f -mtime +1 \
|
||||
-name '*.yaml' -execdir gzip -- {} \;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue