Created
November 1, 2022 23:13
-
-
Save Gronis/eb8b0e0cf7f4eaf2f4560038672f50c1 to your computer and use it in GitHub Desktop.
Reboot if system has less than 64MB of system memory left. Useful when running RAM filesystem and reboots can be used for cleanup. Put in cron
This file contains 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
#!/usr/bin/env bash | |
bash -c "[ $(cat /proc/meminfo | grep MemAvailable | awk '{ printf("%d", $2 < 65536) }') == '1' ] && reboot" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment