File: rotate-client-compress.sh

package info (click to toggle)
ltt-control 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,860 kB
  • sloc: cpp: 192,012; sh: 28,777; ansic: 10,960; python: 7,108; makefile: 3,520; java: 109; xml: 46
file content (14 lines) | stat: -rwxr-xr-x 368 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
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"