Example client to use the session rotation API
[lttng-tools.git] / doc / examples / rotation / rotate-client-compress.sh
diff --git a/doc/examples/rotation/rotate-client-compress.sh b/doc/examples/rotation/rotate-client-compress.sh
new file mode 100755 (executable)
index 0000000..b7e508b
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Receive the path of a chunk of trace, compress it to a temporary directory
+# and delete the chunk.
+
+TRACE_PATH="$1"
+TRACE_NAME="$(basename "$TRACE_PATH")"
+OUT_PATH="$(mktemp -d)"
+
+cd "$TRACE_PATH/.."
+
+tar czf ${OUT_PATH}/${TRACE_NAME}.tar.gz $TRACE_NAME
+echo "New trace chunk archive compressed to ${OUT_PATH}/${TRACE_NAME}.tar.gz"
+rm -rf "$TRACE_PATH"
This page took 0.023036 seconds and 4 git commands to generate.