I run Ubuntu 12.04 to perform the task to read data from the disk which is not cached.
Below is the command I run to drop cache:
echo 3 | sudo tee /proc/sys/vm/drop_caches
Though I run from my admin account, it still requires my password. I want to run it in a batch script without the input password. So, I run the command below:
ALL ALL=(ALL)NOPASSWD:/home/peter/dropCache
When I run the command “sudo -l “ on my admin account, I get the line below:
(ALL) NOPASSWD: /home/peter/dropCache
When I run dropCache script, I still get asked for the password:
./dropCache
[sudo] password for peter:
Can anyone tell me how to run dropCache script as a non root user?