Skip to content

Instantly share code, notes, and snippets.

@tokenvolt
Created March 9, 2015 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tokenvolt/56c2cda732e9864b2d22 to your computer and use it in GitHub Desktop.
Save tokenvolt/56c2cda732e9864b2d22 to your computer and use it in GitHub Desktop.
Very simple script to monitor RAM usage on linux machine
#!/bin/sh
# Using /bin/sh which is guaranteed to be present on any posix system.
# If you want to add shell specific parts in the script than replace this.
# E.g. if you want to use bash specific stuff then change it to:
# #!/usr/bin/env bash
# Make sure that the shebang is on the first line of the script (no comments above it!)
# While true, pause 5 seconds, then append information to Mylogfile
#
# Usage: ./ram-monitor.sh >> logfile &
#
while ( sleep 5 ); do echo "\n=================================" ; date ; free -m ; echo "===================================" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment