Page MenuHomePhabricator
Paste P8379

Authored by dduvall on Apr 9 2019, 9:47 PM.
tmpdir="$(mktemp -d)"
if [[ $# -lt 1 ]]; then
echo "Usage: $(basename "$0") dumpfile ..."
exit 1
if [[ "x$FT_API_KEY" == "x" ]]; then
echo "Please set the FT_API_KEY environment variable to your API key"
exit 2
mkdir -p "$tmpdir"/dumps
for f in "$@"; do
echo Full thread dump Java
tail -n +4 "$f"
) > $tmpdir/dumps/"$(basename "$f")"
cd "$tmpdir"
tar czf dumps.tar.gz dumps/
curl -s -X POST \
--header "Content-Type: application/tar" \
--header "Content-Encoding: application/gzip" \
--data-binary @"$tmpdir"/dumps.tar.gz \
rm "$tmpdir"/dumps/*
rmdir "$tmpdir"/dumps
rm "$tmpdir"/dumps.tar.gz
rmdir "$tmpdir"

Event Timeline

dduvall edited the content of this paste. (Show Details)Apr 9 2019, 9:47 PM
dduvall changed the title of this paste from untitled to
dduvall updated the paste's language from autodetect to sh.