Admin Email Notifications

I am trying to get email notifications sent to the Admin group for my Nextcloud server.

I have test emails working. I am using Postfix.

I understand users can get personal emails set up like so by configuring which notifications they want to receive on their Personal pages.

But what about admins?

I have a cron job set up to run every 15 minuets as stated in the Nextcloud documentation. I do not receive emails however.

My understanding is that Nextcloud administrators are getting the results of the cronjob emailed to them.

How is this done?

Please and thank you! :slight_smile:

P.S. I am using Red Hat Enterprise Linux Server VERSION=“7.3 (Maipo)”. Nextcloud v11.

Could be missing MX record for your domain in your DNS.

Sanook - as mentioned I am successfully getting test emails. Postfix works. I am not even seeing mail being sent in my maillog. (I would see failed email if it was being sent).

I have added to the top of the crontab file. Still nothing.

Any ideas?

Did you threw an eye at the admin settings?

So with the help of timsen in the IRC chat, I solved the issue. Sorry Sanook, you were not understanding the issue.

I created a cronjob using crontab -u apache -e

[root@NEXTCLOUD nextcloud]# crontab -u apache -l

*/15  *  *  *  * php -f /var/www/html/nextcloud/cron.php
0  */6  *  *  * /var/www/html/nextcloud/./

As you can see every 6 hours it executes

This script is composed of:

NOW=$(date +"%Y-%m-%d-%H-%M");
{ sudo -u apache /usr/bin/php /var/www/html/nextcloud/occ user:list; sudo -u apache /usr/bin/php /var/www/html/nextcloud/occ user:report; sudo -u apache /usr/bin/php /var/www/html/nextcloud/occ files:scan --all; }>/var/www/html/nextcloud/nclogs/$LOGFILE; sed '/Scanning/,/+/d' /var/www/html/nextcloud/nclogs/$LOGFILE;

The output looks like the stuff below. As you can see the part with “Scanning…” is removed with sed.

  - user1: user1
  - user2: user2
  - user3: user3
| User Report      |    |
| Database         | 3 |
|                  |    |
| total users      | 3 |
|                  |    |
| user directories | 3 |

| Folders | Files | Elapsed time |
| 100     | 300   | 00:00:00     |