We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b7017b1 + fdf15e0 commit e3aaf3aCopy full SHA for e3aaf3a
resources/ext/cli/prune.erb
@@ -0,0 +1,30 @@
1
+#!/usr/bin/env bash
2
+
3
+usage() {
4
+ echo "Prune contents of report and bucket directories."
5
+ echo
6
+ echo "Usage: puppetserver prune <reportdir|bucketdir> [<ttl>]"
7
+ echo " bucketdir|reportdir work on either bucketdir or reportdir"
8
+ echo " <ttl> delete data older than this amount of time (default: 14d)"
9
+}
10
11
+prune() {
12
+ DIR="$1"
13
+ AGE=${2:-14d}
14
+ puppet apply --no-report --log_level=warning -e "tidy { \$settings::${DIR}: age=>'${AGE}', recurse=>true, rmdirs=>true }"
15
16
17
+case $1 in
18
+ -h|--help)
19
+ usage
20
+ exit 0
21
+ ;;
22
+ bucketdir|reportdir)
23
+ prune "$1" "$2"
24
25
+ *)
26
+ echo "Error: unknown argument."
27
28
+ exit 1
29
30
+esac
0 commit comments