Skip to content

Instantly share code, notes, and snippets.

@tnibert
Created March 9, 2020 00:56
Show Gist options
  • Save tnibert/4d4aeb0f20b2dbe7773f75f546a6d774 to your computer and use it in GitHub Desktop.
Save tnibert/4d4aeb0f20b2dbe7773f75f546a6d774 to your computer and use it in GitHub Desktop.
Monitor linux memory every minute
#! /bin/bash
#log memory each minute
while true; do
dt=`date`
mem=`cat /proc/meminfo | grep -E "MemFree"`
mem2=`cat /proc/meminfo | grep -E "MemAvailable"`
echo -e "$dt \t $mem \t $mem2" | tee -a memlog.txt
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment