0
We know that the command for memory cache cleanup is this:
sync; echo 3 > /proc/sys/vm/drop_caches
However, how to make an executable with a condition (if() Else()), so that this command is executed only when memory usage reaches 80% or more through crontab?
Something like this:
#!/bin/sh
if (uso da memoria > 80%){
sync; echo 3 > /proc/sys/vm/drop_caches
}
Hi Anderson. What part are you struggling with? Do the if in batch script? Extract the percentage of memory used? Set up job in cron? If you prepare a mvce demonstrating the problem becomes easier to help.
– Anthony Accioly
my difficulty is in making an if according to the percentage of memory used. do not know where to start.
– anderson