• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Nginx cron email

PolitisP

New Pleskian
Hello,
As far as I know plesk 11 supports nginx, so I decided to install this component. I installed it from plesk, started it and it seems to work ok, although I receive everyday the following email:

Subject: Cron <root@server> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
Message:
/etc/cron.daily/logrotate:
Reopen NGINX log files: .


Starting from today, gmail bounces these emails, considering them as spam. Is there any way to stop receiving this email and only receive email for nginx in case of a problem?


Installed Plesk version/build: 11.0.9 Debian 6.0
Arch: x86_64
 
Last edited:
please follow the provided instructions:

#cat /etc/cron.daily/logrotate
#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

To disable email notification you can set MAILTO="" variable at the start of your logrotate file:

- Edit/open logrotate
#vi /etc/cron.daily/logrotate
- At the top of the file, enter:
MAILTO=""
- Save and close the file.

You can try to start logrotate manually and see what you got:
# /bin/sh /etc/cron.daily/logrotate
 
Can you give more details of this solution? Adding MAILTO="" to the top of logrotate isn't working for me. Or at least, when I test as directed I don't get the email update, but I still get one every night.

please follow the provided instructions:

#cat /etc/cron.daily/logrotate
#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

To disable email notification you can set MAILTO="" variable at the start of your logrotate file:

- Edit/open logrotate
#vi /etc/cron.daily/logrotate
- At the top of the file, enter:
MAILTO=""
- Save and close the file.

You can try to start logrotate manually and see what you got:
# /bin/sh /etc/cron.daily/logrotate
 
I was trying to find a solution for it today again. So you are a bit lucky. What I tried is the following:

File: /etc/logrotate.d/nginx

I changed: /etc/init.d/nginx reopen || true
to: /etc/init.d/nginx reopen > /dev/null || true

I'm not sure if it'll work, I'll wait till tomorrow to see, but you may want to try this instead, since i bet you'll have higher chance of success:
Change: /etc/init.d/nginx reopen || true
to: /etc/init.d/nginx reopen > /dev/null 2>/dev/null || true
 
Thanks for that PolitisP. Let me know how you get on tomorrow, and I'll do the same.

I was trying to find a solution for it today again. So you are a bit lucky. What I tried is the following:

File: /etc/logrotate.d/nginx

I changed: /etc/init.d/nginx reopen || true
to: /etc/init.d/nginx reopen > /dev/null || true

I'm not sure if it'll work, I'll wait till tomorrow to see, but you may want to try this instead, since i bet you'll have higher chance of success:
Change: /etc/init.d/nginx reopen || true
to: /etc/init.d/nginx reopen > /dev/null 2>/dev/null || true
 
Back
Top