Bash script for clearing caches

Puts filesystem and buffered data which cached in memory (caches) to disk

This goes to anywhere in PATH
Should be ran by root/with sudo
Can be placed in crontab
This commit is contained in:
2025-11-20 08:40:46 +07:00
parent 6d1850a2cf
commit 4b6cb37fe4

5
clearcaches Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/bash
logname="locallogs"
echo "Clearing caches at $(date +%y-%m-%d/%H:%M:%S)" >> /usr/local/$logname && sync && sysctl vm.drop_caches=1