Showing with 20 additions and 6 deletions.
  1. +11 −0 CHANGELOG.md
  2. +1 −1 manifests/pe_metric.pp
  3. +1 −1 metadata.json
  4. +7 −4 templates/tidy_cron.epp
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Z Release 4.4.2

## Bug Fixes:
- Tidy script does not work without bzip (not installed on RHEL 7 by default)
- The tidy script now uses gzip which is more regularly available
- [PR #45](https://github.com/npwalker/pe_metric_curl_cron_jobs/pull/45)
- Tidy script would not exit on error
- [PR #43](https://github.com/npwalker/pe_metric_curl_cron_jobs/pull/43)
- Config file could change every run if you use puppetdb_query to find the hosts
- [PR #42](https://github.com/npwalker/pe_metric_curl_cron_jobs/pull/42)

# Z Release 4.4.1

## Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion manifests/pe_metric.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

$config_hash = {
'hosts' => $hosts,
'hosts' => $hosts.sort(),
'metrics_type' => $metrics_type,
'metrics_port' => $metrics_port,
'additional_metrics' => $additional_metrics,
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npwalker/pe_metric_curl_cron_jobs",
"version": "4.4.1",
"version": "4.4.2",
"author": "npwalker",
"summary": "A Puppet module for gathering metrics from PE components",
"license": "Apache-2.0",
Expand Down
11 changes: 7 additions & 4 deletions templates/tidy_cron.epp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
Integer $retention_days,
| -%>
#!/bin/sh

set -e

DIR='<%= $metrics_output_dir %>';
METRICS_TYPE='<%= $metrics_type %>';
RETENTION_DAYS=<%= $retention_days %>;
Expand All @@ -12,7 +15,7 @@ find "$DIR" -type f -ctime +$RETENTION_DAYS -delete

#compress files
cd "$DIR"
find . -type f ! -name "*.bz2" > "$DIR.tmp";
xargs -a "$DIR.tmp" tar -jcf "$DIR/$METRICS_TYPE-$(date +%Y.%m.%d.%H.%M.%S).tar.bz2" 2>/dev/null;
xargs -a "$DIR.tmp" rm ;
rm "$DIR.tmp";
find . -type f -not -name "*.gz" -a -not -name "*.bz2" > "$DIR.tmp"
xargs -a "$DIR.tmp" tar -zcf "$DIR/$METRICS_TYPE-$(date +%Y.%m.%d.%H.%M.%S).tar.gz"
xargs -a "$DIR.tmp" rm
rm "$DIR.tmp"