X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=doc%2Fexamples%2Frotation%2Frotate-client-compress.sh;fp=doc%2Fexamples%2Frotation%2Frotate-client-compress.sh;h=b7e508b0d70871db0af313af6c55b5cc9e68ec47;hp=0000000000000000000000000000000000000000;hb=7779bc96ee56bdcb10bc91ee0631114a57229049;hpb=329f344308786acb81d8939eb8e1ad37307696c2 diff --git a/doc/examples/rotation/rotate-client-compress.sh b/doc/examples/rotation/rotate-client-compress.sh new file mode 100755 index 000000000..b7e508b0d --- /dev/null +++ b/doc/examples/rotation/rotate-client-compress.sh @@ -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"