Created
March 28, 2023 16:23
-
-
Save apetenchea/6d6c275efcffaa5e8769df3a5d61692d to your computer and use it in GitHub Desktop.
Generate core dumps for all arangod processes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
proc="$(ps aux | grep arangod | grep -v grep)" | |
else | |
proc="$(ps aux | grep arangod | grep -v grep | grep $1)" | |
fi | |
echo "$proc" > ps.txt | |
while IFS= read -r line; do | |
pid=$(echo "$line" | cut -f 3 -d " ") | |
gcore -o "core.arangod" "$pid" | |
done <<< "$proc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment