Skip to content
Open
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 @@

- ``--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 @@

.. 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.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added --cleanup-only flag documentation based on PR #16077 which introduces the -co / --cleanup-only option to ExportSchedulerCommand.php to allow cleanup operations to run separately from report sending.

Source: mautic/mautic#16077


.. note::

For releases prior to 1.1.3, it's required to append ``--env=prod`` to the cron job command to ensure commands execute correctly.

Preventing duplicate Report Emails

Check warning on line 303 in docs/configuration/cron_jobs.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Headings] 'Preventing duplicate Report Emails' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] 'Preventing duplicate Report Emails' should use sentence-style capitalization.", "location": {"path": "docs/configuration/cron_jobs.rst", "range": {"start": {"line": 303, "column": 1}}}, "severity": "WARNING"}
**********************************

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

Check failure on line 306 in docs/configuration/cron_jobs.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Cron' instead of 'cron'. Raw Output: {"message": "[Vale.Terms] Use 'Cron' instead of 'cron'.", "location": {"path": "docs/configuration/cron_jobs.rst", "range": {"start": {"line": 306, "column": 130}}}, "severity": "ERROR"}

1. A cleanup-only job that removes old exported files:

.. code-block:: php

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

2. 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
8 changes: 6 additions & 2 deletions docs/reports/reports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,13 @@

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

``php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID]``
``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. For more information, see :ref:`Cron jobs<send scheduled reports cron job>`.
- 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>`.

Check failure on line 186 in docs/reports/reports.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Cron' instead of 'cron'. Raw Output: {"message": "[Vale.Terms] Use 'Cron' instead of 'cron'.", "location": {"path": "docs/reports/reports.rst", "range": {"start": {"line": 186, "column": 88}}}, "severity": "ERROR"}

Check warning on line 186 in docs/reports/reports.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Reports' instead of 'reports'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Reports' instead of 'reports'.", "location": {"path": "docs/reports/reports.rst", "range": {"start": {"line": 186, "column": 80}}}, "severity": "INFO"}

Check failure on line 186 in docs/reports/reports.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Cron' instead of 'cron'. Raw Output: {"message": "[Vale.Terms] Use 'Cron' instead of 'cron'.", "location": {"path": "docs/reports/reports.rst", "range": {"start": {"line": 186, "column": 56}}}, "severity": "ERROR"}

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