Skip to content

Instantly share code, notes, and snippets.

@fedotxxl
Created March 5, 2015 14:54
Show Gist options
  • Save fedotxxl/b8714f158b56f3dfbdc0 to your computer and use it in GitHub Desktop.
Save fedotxxl/b8714f158b56f3dfbdc0 to your computer and use it in GitHub Desktop.
#!/bin/sh
processName="vs-site"
logsPath="/home/fbelov"
delay=15
logsFullPath=${logsPath}/${processName}-jstack
mkdir -p $logsFullPath
while true
do
pid=$(pgrep -f $processName)
/usr/java/latest/bin/jstack $pid > ${logsFullPath}/stack-`date +%s`.txt
sleep $delay
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment