Mail generated every 30 minutes about FreeDNS

Running Nextcloud 24.
/etc/cron.d/freeDNS is configured to run every 30 minutes /bin/bash /usr/local/bin/freedns.sh.
Thatā€™s okay, but there is an e-mail generated for every successful run with the output of the shell script. Itā€™s generated under the root-account and stored, since there is no real mail functionality. Within one year, about 15 000 mail accumulate.
I like to get rid of this. Did I mis-configure something for this behaviour?

The content of the mail:

FreeDNS client started
https://freedns.afraid.org/dynamic/update.php?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Registered IP: xxx.xxx.xxx.xxx| Current IP: xxx.xxx.xxx.xxx

Nextcloud version (eg, 20.0.5): 24.0.5.1
NextcloudPi version (eg, 20.0.5): v1.50.4
Operating system and version (eg, Ubuntu 20.04): Debian 4.19.260-1 (2022-09-29) x86_64
Apache or nginx version (eg, Apache 2.4.25): apache...
PHP version (eg, 7.4): 7,4

Please ask FreeDNS community as this issue is related to FreeDNS service, and not Nextcloud codebase.

Happy New year.
:firecracker: :tada:

@Heideachim is probably referring to this script nextcloudpi/freeDNS.sh at master Ā· nextcloud/nextcloudpi Ā· GitHub which kind of is part of the Nextcloud code base, or more precisely, the NextcloudPi code base.

Ah! Fair. Then Forget my comment. :slight_smile:

Precisely. Thatā€™s the install script I got my information from.
But then, why does it generate mails for SUCCESSFUL runs?
I would be grateful if somebody could check, if they get those mails as well. Simply issuing a ā€˜sudo mailā€™ (after installing mailutils) should tell. If other people do not get those mails, itā€™ s simply my installation that is screwed up.

Unfortunatley I canā€™t check it, since I donā€™t use NCP. But if I had to guess Iā€™d say the mails are sent by the crontab in /etc/cron.d/freeDNS

If this is the case, and if there is no option to turn it off in the Admin-UI of NCP, I can think of two ways to turn it off:

Edit the crontabā€¦

nano /etc/cron.d/freeDNS

ā€¦and add the following line at the very top of the file:

MAILTO=""

or you could add the following at the end of the line of the cronjob itself, in order to redirect the output to /dev/null:

>/dev/null 2>&1

Hope that helpsā€¦

Thanks for those replies! I modified the solution suggested by bb77ā€™s to the following:

*/30  *  *  *  *  root  /bin/bash /usr/local/bin/freedns.sh 1> /dev/null

This will only kill the output to stdout, but should report any error messages sent to stderr. So if something fails, I still get a mail message, which is okay.
The drawback with this kind of solution (modifying the crontab-file): Whenever a new version of NextCloudPi is installed, this most likely overwrites my changes so I have to re-insert them again by hand.