turn off mail notification from cron.d

uvhost

Verified User
Joined
Mar 26, 2006
Messages
58
Location
UK
Hi,

I'm following this:


I have added this

*/3 * * * * root if ! find /home/*/domains/*/*_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi

in my

/etc/cron.d/openlitespeed_htaccess_scan

I have added this in the end as well

>/dev/null 2>&1

But I still get notifications every three minutes, how do I stop receiving these notifications:



Thanks in advance!
 
with my knowledge

put
Code:
if ! find /home/*/domains/*/*_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi
to some shell script like
reloadhaccess.sh

and put line to "/etc/cron.d/openlitespeed_htaccess_scan" something like this
*/3 * * * * root /somefolder_store_safety_script/reloadhaccess.sh >/dev/null 2>&1

because ">/dev/null 2>&1"
use for one line cmd


So in your image, It's reporting systax error.
that why ">/dev/null 2>&1" won't work

Thanks
 
The emails you get are probably also reporting the error which is a good thing. You need to fix the error first.
 
Back
Top