• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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