• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved How can I stop sending hourly emails notifications from "run-parts /etc/cron.hourly"?

salemhaffar

New Pleskian
Server operating system version
CentOS Linux 7.9.2009
Plesk version and microupdate number
Plesk Obsidian v18.0.48
Hello
I tried all suggestions online without help!
I am receiving every hour an email notification

------------------------------------------
Subject: Cron run-parts /etc/cron.hourly

Body:

/etc/cron.hourly/0anacron:

/etc/cron.hourly/50plesk-hourly:

/etc/cron.hourly/awstats:

/etc/cron.hourly/plesk-php-cleanuper:
---------------------------------------

The Server System information:

VersionPlesk Obsidian v18.0.48_build1800221104.03 os_CentOS 7
OSCentOS Linux 7.9.2009 (Core)

any suggestion?

Thanks in advance..
 
Hi salemhaffar. According to your email body no output is generated from any of the given jobs. In the default Plesk configuration, there should not be any notification sent, because all files provided by Plesk include the
">/dev/null 2>&1"
instruction at the end of the commands. On CentOS 7.9 there is no hourly notification with empty results.

In your case you can check the /etc/crontab file, /etc/cron.d directory content and files in your /etc/cron.hourly directory if any of them looks suspicious (e.g. was modified) or if additional files exist that trigger the hourly mails.
 
Thank you for your reply

nothing looks suspicious
this is the "/etc/crontab" file
---------------------------
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
---------------------------------------

and this is the "/etc/cron.d" file:
-----------------------
# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
01 * * * * root run-parts /etc/cron.hourly
-------------------------

should I modify the line to

01 * * * * root run-parts /etc/cron.hourly >/dev/null

or just change the "MAILTO=root" to MAILTO=""

Thanks for the help
 
The content you are showing is the default and should not be changed. The reason must then be somewhere else, e.g. in some of the hourly jobs. Maybe a 3rd party software package has added something there? It's really difficult to tell without knowing your system. If you wish someone to look into this on your server, I recommend to open a ticket with official Plesk support. They can fix this directly on your server. In case you do not yet have a support subscription: There is trial month.
 
This was the Plesk support team's response

Hello,

Thank you for reaching Plesk Technical Support.

That does occur because of the MAILTO=root specified within the 0hourly script:
# cat /etc/cron.d/0hourly
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
01 * * * * root run-parts /etc/cron.hourly

and acacrontab:
# cat /etc/anacrontab
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
You can remove that if you wish not to receive the notifications.
 
Noted.

I get the same notices, but MAILTO=root was removed from these two files. I restored crond. No change.

Here's the output:

[root@server ~]# cat /etc/cron.d/0hourly
# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
01 * * * * root run-parts /etc/cron.hourly
[root@server ~]# cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22

#period in days delay in minutes job-identifier command
1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
[root@server ~]#
 
Back
Top