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. Mautic
  3. Adjust cron jobs for Mautic... is it possible?

Adjust cron jobs for Mautic... is it possible?

Scheduled Pinned Locked Moved Mautic
18 Posts 6 Posters 2.5k Views 7 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.
    • dsp76D Offline
      dsp76D Offline
      dsp76
      wrote on last edited by girish
      #1

      Hi,
      as the standard setup regarding cron jobs is not optimal... how much can I adjust an installation in cloudron without breaking it?

      That's the reason and possible solution: https://twentyzen.com/en/think/faq-items/start-mautic-cron-jobs-in-sequence/

      So I would need to add an own individual shell script file and call this instead of the individual mautic commands.

      (Ask me about B2B marketing automation & low code business solutions, if thats interesting for you.)

      1 Reply Last reply
      1
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #2

        Tried to understand what is written in the linked post, but not sure I am following the necessity of what they mention there.

        For refrence in Cloudron the contab for mautic is https://git.cloudron.io/cloudron/mautic-app/-/blob/master/crontab.system.template?ref_type=heads

        1 Reply Last reply
        0
        • dsp76D Offline
          dsp76D Offline
          dsp76
          wrote on last edited by
          #3

          Thanks for the feedback, will rework this article as the next step.

          The reason why this initial Mautic Setup is not used by us and other Mautic Partners: The staggered setting of making sure that the commands run in the right sequence:

          • 0,15,30,45 * * * * (echo "==> cron: mautic:segments:update"; sudo -E -u www-data php /app/code/bin/console mautic:segments:update) > /proc/$(cat /var/run/crond.pid)/fd/1 2>&1
          • 5,20,35,50 * * * * (echo "==> cron: mautic:campaigns:update"; sudo -E -u www-data php /app/code/bin/console mautic:campaigns:update) > /proc/$(cat /var/run/crond.pid)/fd/1 2>&1
          • 10,25,40,55 * * * * (echo "==> cron: mautic:campaigns:trigger"; sudo -E -u www-data php /app/code/bin/console mautic:campaigns:trigger) > /proc/$(cat /var/run/crond.pid)/fd/1 2>&1

          With that setup, the Marketing Automation needs at average 12,5 minutes, before a client gets a response from the system. Thats no acceptable, as it negatively impacts response rates and conversion rates. Just imagine, you want to get some information, fill in a form and don't get a response in a timely manner.

          We reworked the cronjob setup to concatenate those commands in a shell script and run it - depending on the server speed and the load - every 1-3 minutes.

          /PATHTOPHP/php /PATHTOMAUTIC/app/console mautic:segments:update && /PATHTOPHP/php /PATHTOMAUTIC/app/console mautic:campaigns:update & /PATHTOPHP/php /PATHTOMAUTIC/app/console mautic:campaigns:trigger
          

          So in order to achieve that, I need to be able to

          • disable the default cloudron cronjobs for mautic (will it be persistent across updates?) and
          • run a custom shell script containing those commands instead (will this shell script stay there across updates?).

          Hope this clarifies the reason behind it.

          (Ask me about B2B marketing automation & low code business solutions, if thats interesting for you.)

          1 Reply Last reply
          0
          • nebulonN Offline
            nebulonN Offline
            nebulon
            Staff
            wrote on last edited by nebulon
            #4

            I am no mautic expert, so I can't fully follow this requirement still. However, have you seen https://docs.cloudron.io/apps/mautic/#custom-cron-jobs for custom cron jobs with mautic?

            Ideally if this is something all mautic users in the end need (hopefully other can contribute to the discussion here) I guess it would be better to adjust the package cron then.

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

              You can edit the /app/data/crontab.system patterns as you wish . See https://docs.cloudron.io/apps/mautic/#system-cron-jobs . I agree that mautic's flow of calling cron for everything is suboptimial. This is why the package made the patterns editable . In fact, for processing any task, the mautic way is to run a cronjob manually.

              dsp76D 1 Reply Last reply
              1
              • dsp76D Offline
                dsp76D Offline
                dsp76
                wrote on last edited by
                #6

                Would that mean I can add my custom script (that calls the CLI commands) and add a cronjobs for this?

                (Ask me about B2B marketing automation & low code business solutions, if thats interesting for you.)

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

                  Yes, you can add your custom script that calls CLI comands in https://docs.cloudron.io/apps/mautic/#custom-cron-jobs

                  1 Reply Last reply
                  1
                  • girishG girish

                    You can edit the /app/data/crontab.system patterns as you wish . See https://docs.cloudron.io/apps/mautic/#system-cron-jobs . I agree that mautic's flow of calling cron for everything is suboptimial. This is why the package made the patterns editable . In fact, for processing any task, the mautic way is to run a cronjob manually.

                    dsp76D Offline
                    dsp76D Offline
                    dsp76
                    wrote on last edited by
                    #8

                    @girish said in Adjust cron jobs for Mautic... is it possible?:

                    You can edit the /app/data/crontab.system patterns as you wish . See https://docs.cloudron.io/apps/mautic/#system-cron-jobs . I agree that mautic's flow of calling cron for everything is suboptimial. This is why the package made the patterns editable . In fact, for processing any task, the mautic way is to run a cronjob manually.

                    Will this file stay intact with every Mautic update via cloudron? Because I would then comment them out and completely replace them with custom cron jobs.

                    (Ask me about B2B marketing automation & low code business solutions, if thats interesting for you.)

                    1 Reply Last reply
                    0
                    • nebulonN Offline
                      nebulonN Offline
                      nebulon
                      Staff
                      wrote on last edited by
                      #9

                      Yes the cronjobs configured via the UI will persist the update. All in all I am still unsure if its now a good or bad idea to provide default cron jobs for mautic or not. Maybe active mautic users could give some more insights on this?

                      1 Reply Last reply
                      0
                      • dsp76D Offline
                        dsp76D Offline
                        dsp76
                        wrote on last edited by dsp76
                        #10

                        We have years long experience with mautic 😉

                        Its important to help with a default cronjob setup. The one from the docs work, but its not optimal. I will help setting it up in a better way together with you, if you like.

                        For now it would be good, if the out of the box setup for cronjobs in cloudron could also be disabled. I did it by commenting out every line in the crontab.system - but will this be replaced again by an update or not? Its in the /app/data directory. So I think it will not?

                        I already changed my cronjob setup with a shell file. I trigger this every minute, in case its still running, it will be ignored. I will need to extend it by other optional cronjob tasks - maybe having even two or more scripts. One to run every minute (if server can handle it). And then some maintenance task that don't need to run that often.

                        Update - the current version can now be found at:
                        https://github.com/twentyZen/mautic-cronjobs

                        Myself I'm not a script or Linux Professional. Probably that approach can be improved.

                        (Ask me about B2B marketing automation & low code business solutions, if thats interesting for you.)

                        jordanurbsJ 1 Reply Last reply
                        2
                        • dsp76D Offline
                          dsp76D Offline
                          dsp76
                          wrote on last edited by
                          #11

                          For instance - whats the php memory limit on cli? Is it the same limit as for the mautic instance overall?

                          (Ask me about B2B marketing automation & low code business solutions, if thats interesting for you.)

                          girishG 1 Reply Last reply
                          0
                          • dsp76D dsp76 referenced this topic on
                          • dsp76D dsp76

                            For instance - whats the php memory limit on cli? Is it the same limit as for the mautic instance overall?

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

                            @dsp76 By default, the cli and apache have same php memory limit - 512M . If you change the memory_limit in /app/data/php.ini , it will affect both.

                            1 Reply Last reply
                            1
                            • rmdesR Offline
                              rmdesR Offline
                              rmdes
                              wrote on last edited by
                              #13

                              Any having issues with cron jobs ?

                              my segments have stopped updating automatically but I haven't touched the crontab.system or crontab.user
                              neither have I customized anything regarding cron jobs in Mautic

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

                                Anything in the logs? Which mautic package are you on?

                                jordanurbsJ 1 Reply Last reply
                                0
                                • dsp76D dsp76 referenced this topic on
                                • dsp76D dsp76

                                  We have years long experience with mautic 😉

                                  Its important to help with a default cronjob setup. The one from the docs work, but its not optimal. I will help setting it up in a better way together with you, if you like.

                                  For now it would be good, if the out of the box setup for cronjobs in cloudron could also be disabled. I did it by commenting out every line in the crontab.system - but will this be replaced again by an update or not? Its in the /app/data directory. So I think it will not?

                                  I already changed my cronjob setup with a shell file. I trigger this every minute, in case its still running, it will be ignored. I will need to extend it by other optional cronjob tasks - maybe having even two or more scripts. One to run every minute (if server can handle it). And then some maintenance task that don't need to run that often.

                                  Update - the current version can now be found at:
                                  https://github.com/twentyZen/mautic-cronjobs

                                  Myself I'm not a script or Linux Professional. Probably that approach can be improved.

                                  jordanurbsJ Offline
                                  jordanurbsJ Offline
                                  jordanurbs
                                  wrote on last edited by jordanurbs
                                  #15

                                  hey @dsp76 thanks for sharing... so if I install this shell file to my Mautic installation on Cloudron, it'll speed up the cronjobs?

                                  Unfortunately I'm unable to add an .env file because on Cloudron the app is a "read only filesystem"

                                  dsp76D 1 Reply Last reply
                                  0
                                  • girishG girish

                                    Anything in the logs? Which mautic package are you on?

                                    jordanurbsJ Offline
                                    jordanurbsJ Offline
                                    jordanurbs
                                    wrote on last edited by
                                    #16

                                    @girish same problem for me as @rmdes (I know it was over a year ago, but it's what lead me to this thread)

                                    cloudron v8.2.4
                                    Mautic 5.2.3

                                    1 Reply Last reply
                                    0
                                    • J Offline
                                      J Offline
                                      joseph
                                      Staff
                                      wrote on last edited by
                                      #17

                                      @jordanurbs have you tried running the cronjob manually . https://docs.cloudron.io/apps/mautic/#system-cron-jobs ? Maybe it's erroring?

                                      1 Reply Last reply
                                      0
                                      • jordanurbsJ jordanurbs

                                        hey @dsp76 thanks for sharing... so if I install this shell file to my Mautic installation on Cloudron, it'll speed up the cronjobs?

                                        Unfortunately I'm unable to add an .env file because on Cloudron the app is a "read only filesystem"

                                        dsp76D Offline
                                        dsp76D Offline
                                        dsp76
                                        wrote on last edited by
                                        #18

                                        @jordanurbs you could put those in the /app/data folder which is writeable?

                                        (Ask me about B2B marketing automation & low code business solutions, if thats interesting for you.)

                                        1 Reply Last reply
                                        1
                                        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