Skip to content

Instantly share code, notes, and snippets.

@opennikish
Last active August 6, 2022 17:32
Show Gist options
  • Save opennikish/516b5fd5fe2ef8ed2c1cc2c592907e0e to your computer and use it in GitHub Desktop.
Save opennikish/516b5fd5fe2ef8ed2c1cc2c592907e0e to your computer and use it in GitHub Desktop.
Simple server resource statistic reporter script
#!/bin/bash
# Usage: ./top.sh 5 | tee report.log
INTERVAL=$1
while true; do
top -b -n 1 | head -n 6 # Use `-l 1` for `-b` (batchmode) on macos
sleep $INTERVAL
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment