-
Open and make a sh file:
sudo nano clean.sh
-
Copy and paste text below:
echo printf " 🧹🧹🧹 Memory Before Clean 🧹🧹🧹" echo echo free -m sync; sudo echo 2 | sudo tee /proc/sys/vm/drop_caches echo printf " 🧹🧹🧹 Memory After Clean 🧹🧹🧹" echo echo free -m echo echo printf "DONE !!!" echo printf "🧽🧽🧽 RAM CACHE CLEARED 🧽🧽🧽" echo
To save : Ctrl+x then y then Enter
-
Set permission to file:
sudo chmod 755 clean.sh
-
Run Script:
sudo ./clean.sh
Add a keyboard shorcut to execute script.
OR
Create cron job to schedule a time to run the script.
-
Open cron file:
crontab -e
-
Enter text at end file:
0 */2 * * * sudo ./clean.sh
Script will run every 2 hours