Skip to content

Instantly share code, notes, and snippets.

@martynjarvis
Last active August 29, 2015 14:06
Show Gist options
  • Save martynjarvis/2dc98eb41f0016fa61ba to your computer and use it in GitHub Desktop.
Save martynjarvis/2dc98eb41f0016fa61ba to your computer and use it in GitHub Desktop.
Simple bash script to monitor something.
#!/bin/bash
LOGFILE=/tmp/monitor.log
CMD="cat /proc/loadavg"
DELAY=60
while true; do
echo "$(date -u): $(eval $CMD)" >> $LOGFILE 2>&1
sleep $DELAY
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment