Skip to content

Instantly share code, notes, and snippets.

@fdeantoni
Last active February 3, 2016 07:25
Show Gist options
  • Save fdeantoni/8002a3737f20a9c3c45c to your computer and use it in GitHub Desktop.
Save fdeantoni/8002a3737f20a9c3c45c to your computer and use it in GitHub Desktop.
ps monitoring
#!/usr/bin/env bash
LOG="/home/allied/ps.log"
nohup ./ps_output.sh > ${LOG} 2>&1 &
#!/usr/bin/env bash
# Every 10 seconds output ps info sorted by CPU utilization (highest first)
while true; do
printf "\n>>>> `date` (`date -u '+%Y-%m-%d %H:%M:%S'` UTC):\n";
ps aux --sort -pcpu;
sleep 10s;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment