Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions docs/configuration/cron_jobs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ Command parameters:

- ``--min-contact-id`` and ``--max-contact-id`` allows the separation of Email sending by smaller chunks, by specifying contact ID ranges. If those ranges won't overlap, this allows you to run several broadcast commands in parallel.

.. _send scheduled Reports Cron job:

.. vale off

Send scheduled Reports cron job
Expand All @@ -285,11 +287,37 @@ Starting with Mautic 2.12.0, it's now possible to use cron to send scheduled Rep

.. code-block:: php

php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID]
php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID] [--cleanup-only]

.. note::
Command parameters
------------------

- ``--report=ID`` specifies a Report by ID. If not provided, processes all scheduled Reports.

- ``--cleanup-only`` runs only the cleanup operation, removing old exported Report files without sending scheduled Reports. Use this to separate the cleanup and sending tasks to prevent duplicate Report Emails.
Comment thread
escopecz marked this conversation as resolved.

.. vale off

Preventing duplicate Report Emails
**********************************
Comment thread
adiati98 marked this conversation as resolved.

.. vale on

Running the Report send and cleanup operations at the same time can cause duplicate Report Emails. To prevent this, run separate Cron jobs:

#. A cleanup-only job that removes old exported files without sending Report Emails:

.. code-block:: php

php /path/to/mautic/bin/console mautic:reports:scheduler --cleanup-only

#. A separate job that sends scheduled Reports:

.. code-block:: php

php /path/to/mautic/bin/console mautic:reports:scheduler

for releases prior to 1.1.3, it's required to append ``--env=prod`` to the cron job command to ensure commands execute correctly.
Stagger these jobs so they don't run at the same time.

.. vale off

Expand Down
10 changes: 8 additions & 2 deletions docs/reports/reports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,15 @@ Cron job to schedule Reports

Mautic requires the following cron command to be able to send scheduled Reports:

``php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID]``
.. code-block:: php

The ``--report=ID`` argument allows you to specify a Report by ID if required. For more information, see :ref:`Cron jobs<send scheduled reports cron job>`.
php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID] [--cleanup-only]

* The ``--report=ID`` argument allows you to specify a Report by ID if required.

* The ``--cleanup-only`` argument runs only the cleanup operation to remove old exported files without sending Reports.

For more information, see :ref:`Send scheduled Reports Cron job<send scheduled Reports Cron job>`.

Report options
==============
Expand Down
Loading