Last active
August 6, 2022 17:32
-
-
Save opennikish/08383f95f8f1d433a24fe5b58e06ce5a to your computer and use it in GitHub Desktop.
Simple process statistic reporter script
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
PID=$1 | |
INTERVAL=$2 | |
# Usage: ./top-pid.sh 12345 5 | tee report.log | |
while true; do | |
top -n 1 -b -pid $PID | tail -2 # Use `-l 1` for `-b` (batchmode) on macos | |
echo -n "\n" | |
sleep $INTERVAL | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment