Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Nextcloud
  3. Are cron jobs setup to run for email notifications from Nextcloud?

Are cron jobs setup to run for email notifications from Nextcloud?

Scheduled Pinned Locked Moved Nextcloud
8 Posts 2 Posters 1.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • marcusquinnM Offline
      marcusquinnM Offline
      marcusquinn
      wrote on last edited by
      #1

      I'm testing settings for getting an email when a file is uploaded to a dropbox.

      • Test emails work fine.
      • User has email filled in
      • Settings > Personal > Activity > “A file or folder has been changed” is ticked.
      • Push notifications are working.

      This thread seems to suggest it was a fixed issue a while ago but relies on the cron setup:

      • https://github.com/nextcloud/activity/issues/244

      Maybe I'm missing something or all install don't have this setup?

      Web Design https://www.evergreen.je
      Development https://brandlight.org
      Life https://marcusquinn.com

      girishG 2 Replies Last reply
      0
      • marcusquinnM marcusquinn

        I'm testing settings for getting an email when a file is uploaded to a dropbox.

        • Test emails work fine.
        • User has email filled in
        • Settings > Personal > Activity > “A file or folder has been changed” is ticked.
        • Push notifications are working.

        This thread seems to suggest it was a fixed issue a while ago but relies on the cron setup:

        • https://github.com/nextcloud/activity/issues/244

        Maybe I'm missing something or all install don't have this setup?

        girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #2

        @marcusquinn Do you see a log line "==> Run cron job" ? It should run every 5 mins.

        marcusquinnM 1 Reply Last reply
        0
        • marcusquinnM marcusquinn

          I'm testing settings for getting an email when a file is uploaded to a dropbox.

          • Test emails work fine.
          • User has email filled in
          • Settings > Personal > Activity > “A file or folder has been changed” is ticked.
          • Push notifications are working.

          This thread seems to suggest it was a fixed issue a while ago but relies on the cron setup:

          • https://github.com/nextcloud/activity/issues/244

          Maybe I'm missing something or all install don't have this setup?

          girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #3

          @marcusquinn Oh it seems the app does not used nextcloud's cron but needs it's own cron via occ activity:send-mails. So that definitely won't work since nobody is running that periodically.

          1 Reply Last reply
          0
          • girishG girish

            @marcusquinn Do you see a log line "==> Run cron job" ? It should run every 5 mins.

            marcusquinnM Offline
            marcusquinnM Offline
            marcusquinn
            wrote on last edited by marcusquinn
            #4

            @girish Makes sense, yeah => Run cron job is there.

            Yeah, I think there's some decisions to make on what's the best settings. The last comment and link in that GitHub thread would seem like the best option to me:

            • https://www.schilljs.com/2017/05/09/better-scheduling-of-activity-emails.html
            # crontab -u www-data -e
             0  *  *  *  *    php -f /var/www/nextcloud/occ activity:send-mails hourly
            30  7  *  *  *    php -f /var/www/nextcloud/occ activity:send-mails daily
            30  7  *  *  MON  php -f /var/www/nextcloud/occ activity:send-mails weekly
            

            Then this looks best for real-time/instant email notifications but I'm not sure if that would create log-litter or what's best-practice in thinking about how it might scale:

            * * * * * www-data php /var/www/html/nextcloud/occ activity:send-mails
            
            • https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/background_jobs_configuration.html#cron

            Web Design https://www.evergreen.je
            Development https://brandlight.org
            Life https://marcusquinn.com

            1 Reply Last reply
            0
            • marcusquinnM Offline
              marcusquinnM Offline
              marcusquinn
              wrote on last edited by
              #5

              Correction, only the in-app/browser notification works, the native Push iOS notification doesn't, so I guess triggered by the same script as the emails would be.

              Nextcloud is super-handy as a files dropbox with a non-guessable shared link - just knowing when something's been uploaded to then go and look would be useful, and I'm sure to others now you know it's possible when running.

              Web Design https://www.evergreen.je
              Development https://brandlight.org
              Life https://marcusquinn.com

              1 Reply Last reply
              0
              • girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #6

                Usually, for "flexible" things like this, we just have the user setup a crontab in the app. These cron timings tend to be fairly opinionated. I wonder why this is needed though, does nextcloud have no way for apps to integrate with the built-in cron they have (like wordpress plugins do?).

                1 Reply Last reply
                0
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #7

                  Actually, https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html says apps can register to cron.php. Is this an upstream app issue?

                  marcusquinnM 1 Reply Last reply
                  0
                  • girishG girish

                    Actually, https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html says apps can register to cron.php. Is this an upstream app issue?

                    marcusquinnM Offline
                    marcusquinnM Offline
                    marcusquinn
                    wrote on last edited by
                    #8

                    @girish Yeah, I read that, and it seems to you setup Cron by default with the email settings anyway at: /settings/admin where the Test email button seems to work, so that part seems good.

                    Notifications is a core/default App as I understand at: /settings/apps/installed/notifications

                    This is what I have set here: /settings/user/activity

                    81f3c895-c03e-4c96-bbe1-ef1431ddfd93-image.png

                    And the folders are just the default and this extra shared folder:

                    6e9f270e-3e2e-46bd-874a-4c69a7b0de64-image.png

                    Web Design https://www.evergreen.je
                    Development https://brandlight.org
                    Life https://marcusquinn.com

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search