This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### This script is provided with the hopes that it will be useful, but without any warranty of any kind. This script to be used AT YOUR OWN RISK. ### | |
| date > /var/tmp/_free.tmp.txt | |
| free >> /var/tmp/_free.tmp.txt | |
| ramTotal="$(awk '/Mem/ {print $2}' /var/tmp/_free.tmp.txt)" | |
| ramUsed="$(awk '/+/ {print $3}' /var/tmp/_free.tmp.txt)" | |
| ramFree="$(awk '/+/ {print $4}' /var/tmp/_free.tmp.txt)" | |
| swapTotal="$(awk '/Swap/ {print $2}' /var/tmp/_free.tmp.txt)" | |
| swapUsed="$(awk '/Swap/ {print $3}' /var/tmp/_free.tmp.txt)" | |
| swapFree="$(awk '/Swap/ {print $4}' /var/tmp/_free.tmp.txt)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # USE AT YOUR OWN RISK!!! | |
| # | |
| # play nice and clean up on exit | |
| function exitcleanup { | |
| if [ $success ] | |
| then | |
| echo -e "\\n--------------- $end iterations every $sleep seconds completed successfully ---------------" | |
| echo -e "\\n--------------- $end iterations every $sleep seconds completed successfully ---------------" >> $output | |
| else |