Page 1 of 1

auto clear cache cronjob problem

Posted: Fri Jul 26, 2019 9:39 am
by Teo
Hello everyone!

I'm trying to add this cronjob:

Code: Select all

sudo /usr/bin/bash /home/clearcache.sh
user is Admin allowed to run bash, Centos6 the file clearcache.sh (permission 755) contains:

Code: Select all

#!/bin/bash
# Note, we are using "echo 3", but it is not recommended in production instead use "echo 1"
echo "echo 3 > /proc/sys/vm/drop_caches"
the error I get is:
sudo: no tty present and no askpass program specified
I tried this but it doesn't work:
viewtopic.php?t=17707

any thoughts?
thank you!

Re: auto clear cache cronjob problem

Posted: Wed Jul 31, 2019 3:03 pm
by skamasle
That system you use ?

Why not run this specific crons with root user ?