I'm trying to clear memory cache using cron.
Cron file:
*/2 * * * * ~/clear_mem.sh
clear_mem.sh:
#!/bin/sh
sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
touch f
File f
is created every two minutes. But memory isn't cleared. If I call script by hands everything is fine. Why?