# Mautic Command Options and Arguments

**URL:** <https://forum.mautic.org/t/mautic-command-options-and-arguments/18638>\
**Category:** Documentation\
**Created:** [March 19, 2021, 5:34pm UTC](https://forum.mautic.org/t/mautic-command-options-and-arguments/18638 "2021-03-19T17:34:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [March 19, 2021, 5:34pm UTC](https://forum.mautic.org/t/mautic-command-options-and-arguments/18638/1 "2021-03-19T17:34:59Z")

</div>

Threw together a quick and dirty list of cron/ssh commands with a list of options and the explanation. I got this info by running --help with the most commonly used commands.

Update contacts in smart segments based on new contact data.  
mautic:segments:update [options]  
mautic:segments:rebuild

Options:  
-b, --batch-limit[=BATCH-LIMIT]  
Set batch size of contacts to process per round. Defaults to 300. [default: 300]  
-m, --max-contacts[=MAX-CONTACTS]  
Set max number of contacts to process per segment for this script execution. Defaults to all. [default: false]  
-i, --list-id[=LIST-ID]  
Specific ID to rebuild. Defaults to all. [default: false]  
-f, --force  
Force execution even if another process is assumed running.  
–bypass-locking  
Bypass locking.  
-t, --timeout=TIMEOUT  
If getmypid() is disabled on this system, lock files will be used. This option will assume the process is dead after the specified number of seconds and will execute anyway. This is disabled by default. [default: false]

-x, --lock\_mode=LOCK\_MODE  
Allowed value are “pid” , “file\_lock” or “flock”. By default, lock will try with pid, if not available will use file system [default: “pid”]  
-h, --help  
Display this help message  
-q, --quiet  
Do not output any message  
-V, --version  
Display this application version  
–ansi  
Force ANSI output  
–no-ansi  
Disable ANSI output  
-n, --no-interaction  
Do not ask any interactive question  
-e, --env=ENV  
The Environment name. [default: “prod”]  
–no-debug  
Switches off debug mode.  
-tm, --timing[=TIMING]  
Measure timing of build with output to CLI . [default: false]  
-v|vv|vvv, --verbose  
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Rebuild campaigns based on contact segments.Usage:  
mautic:campaigns:rebuild [options]  
mautic:campaigns:update

Options:  
-l, --batch-limit[=BATCH-LIMIT]  
Set batch size of contacts to process per round. Defaults to 300. [default: 300]  
-m, --max-contacts[=MAX-CONTACTS]  
Set max number of contacts to process per campaign for this script execution. Defaults to all. [default: 0]  
-i, --campaign-id[=CAMPAIGN-ID]  
Build membership for a specific campaign. Otherwise, all campaigns will be rebuilt.  
–contact-id[=CONTACT-ID]  
Build membership for a specific contact.  
–contact-ids[=CONTACT-IDS]  
CSV of contact IDs to evaluate.  
–min-contact-id[=MIN-CONTACT-ID]  
Build membership starting at a specific contact ID.  
–max-contact-id[=MAX-CONTACT-ID]  
Build membership up to a specific contact ID.  
–thread-id[=THREAD-ID]  
The number of this current process if running multiple in parallel.  
–max-threads[=MAX-THREADS]  
The maximum number of processes you intend to run in parallel.  
-f, --force  
Force execution even if another process is assumed running.  
–bypass-locking  
Bypass locking.  
-t, --timeout=TIMEOUT  
If getmypid() is disabled on this system, lock files will be used. This option will assume the process is dead after the specified number of seconds and will execute anyway. This is disabled by default. [default: false]  
-x, --lock\_mode=LOCK\_MODE  
Allowed value are “pid” , “file\_lock” or “flock”. By default, lock will try with pid, if not available will use file system [default: “pid”]  
-h, --help  
Display this help message  
-q, --quiet  
Do not output any message  
-V, --version  
Display this application version  
–ansi  
Force ANSI output  
–no-ansi  
Disable ANSI output  
-n, --no-interaction  
Do not ask any interactive question  
-e, --env=ENV  
The Environment name. [default: “prod”]  
–no-debug  
Switches off debug mode.  
-v|vv|vvv, --verbose  
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Trigger timed events for published campaigns.  
Usage:  
mautic:campaigns:trigger [options]

Options:  
-i, --campaign-id[=CAMPAIGN-ID]  
Trigger events for a specific campaign. Otherwise, all campaigns will be triggered.  
–campaign-limit[=CAMPAIGN-LIMIT]  
Limit number of contacts on a per campaign basis  
–contact-id[=CONTACT-ID]  
Trigger events for a specific contact.  
–contact-ids[=CONTACT-IDS]  
CSV of contact IDs to evaluate.  
–min-contact-id[=MIN-CONTACT-ID]  
Trigger events starting at a specific contact ID.  
–max-contact-id[=MAX-CONTACT-ID]  
Trigger events starting up to a specific contact ID.  
–thread-id[=THREAD-ID]  
The number of this current process if running multiple in parallel.  
–max-threads[=MAX-THREADS]  
The maximum number of processes you intend to run in parallel.  
–kickoff-only  
Just kickoff the campaign  
–scheduled-only  
Just execute scheduled events  
–inactive-only  
Just execute scheduled events  
-l, --batch-limit[=BATCH-LIMIT]  
Set batch size of contacts to process per round. Defaults to 100. [default: 100]  
-f, --force  
Force execution even if another process is assumed running.  
–bypass-locking  
Bypass locking.  
-t, --timeout=TIMEOUT  
If getmypid() is disabled on this system, lock files will be used. This option will assume the process is dead after the specified number of seconds and will execute anyway. This is disabled by default. [default: false]  
-x, --lock\_mode=LOCK\_MODE  
Allowed value are “pid” , “file\_lock” or “flock”. By default, lock will try with pid, if not available will use file system [default: “pid”]  
-h, --help  
Display this help message  
-q, --quiet  
Do not output any message  
-V, --version  
Display this application version  
–ansi  
Force ANSI output  
–no-ansi  
Disable ANSI output  
-n, --no-interaction  
Do not ask any interactive question  
-e, --env=ENV  
The Environment name. [default: “prod”]  
–no-debug  
Switches off debug mode.  
-v|vv|vvv, --verbose  
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:

The mautic:import command starts to import CSV files when some are created.  
Usage:  
mautic:import [options]

Options:  
-i, --id[=ID]  
Specific ID to import. Defaults to next in the queue. [default: false]  
-l, --limit[=LIMIT]  
Maximum number of records to import for this script execution. [default: 0]  
-h, --help  
Display this help message  
-q, --quiet  
Do not output any message  
-V, --version  
Display this application version  
–ansi  
Force ANSI output  
–no-ansi  
Disable ANSI output  
-n, --no-interaction  
Do not ask any interactive question  
-e, --env=ENV  
The Environment name. [default: “prod”]  
–no-debug  
Switches off debug mode.  
-v|vv|vvv, --verbose  
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

The mautic:emails:send command is used to process the application’s e-mail queue

mautic:emails:send [options]

Options:  
–message-limit[=MESSAGE-LIMIT]  
Limit number of messages sent at a time. Defaults to value set in config.  
–time-limit[=TIME-LIMIT]  
Limit the number of seconds per batch. Defaults to value set in config.  
–do-not-clear  
By default, failed messages older than the --recover-timeout setting will be attempted one more time then deleted if it fails again. If this is set, sending of failed messages will continue to be attempted.  
–recover-timeout[=RECOVER-TIMEOUT]  
Sets the amount of time in seconds before attempting to resend failed messages. Defaults to value set in config.  
–clear-timeout[=CLEAR-TIMEOUT]  
Sets the amount of time in seconds before deleting failed messages. Defaults to value set in config.  
–lock-name[=LOCK-NAME]  
Set name of lock to run multiple mautic:emails:send command at time  
-f, --force  
Force execution even if another process is assumed running.  
–bypass-locking  
Bypass locking.  
-t, --timeout=TIMEOUT  
If getmypid() is disabled on this system, lock files will be used. This option will assume the process is dead after the specified number of seconds and will execute anyway. This is disabled by default. [default: false]  
-x, --lock\_mode=LOCK\_MODE  
Allowed value are “pid” , “file\_lock” or “flock”. By default, lock will try with pid, if not available will use file system [default: “pid”]  
-h, --help  
Display this help message  
-q, --quiet  
Do not output any message  
-V, --version  
Display this application version  
–ansi  
Force ANSI output  
–no-ansi  
Disable ANSI output  
-n, --no-interaction  
Do not ask any interactive question  
-e, --env=ENV  
The Environment name. [default: “prod”]  
–no-debug  
Switches off debug mode.  
-v|vv|vvv, --verbose  
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

The mautic:email:fetch command is used to fetch and process messages such as bounces and unsubscribe requests. Configure the Monitored Email settings in Mautic’s Configuration.

mautic:email:fetch [options]  
mautic:emails:fetch

Options:  
-m, --message-limit[=MESSAGE-LIMIT]  
Limit number of messages to process at a time.  
-h, --help  
Display this help message  
-q, --quiet  
Do not output any message  
-V, --version  
Display this application version  
–ansi  
Force ANSI output  
–no-ansi  
Disable ANSI output  
-n, --no-interaction  
Do not ask any interactive question  
-e, --env=ENV  
The Environment name. [default: “prod”]  
–no-debug  
Switches off debug mode.  
-v|vv|vvv, --verbose  
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [March 19, 2021, 5:45pm UTC](https://forum.mautic.org/t/mautic-command-options-and-arguments/18638/2 "2021-03-19T17:45:53Z")

</div>

Perhaps you could make an update to the docs:

> **[Cron jobs](https://docs.mautic.org/en/setup/cron-jobs)**
>
> . . . . Mautic 3 introduced a new path for cron jobs bin/console if you are using the legacy Mautic 2.x series you should replace this with the older version, app/console. . . . Mautic requires a few cron jobs to handle some maintenance tasks such as...

There is a link at the bottom of the page where you can suggest edits and make a pull request!

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [July 30, 2021, 10:40am UTC](https://forum.mautic.org/t/mautic-command-options-and-arguments/18638/3 "2021-07-30T10:40:44Z")

</div>

As a newbie, this is very useful. Thank you!

This however is not clear:

> [@EJL](#):
>
> The mautic:import command starts to import CSV files when some are created.

Could you clarify where the CSVs need to be?

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [July 30, 2021, 2:03pm UTC](https://forum.mautic.org/t/mautic-command-options-and-arguments/18638/4 "2021-07-30T14:03:54Z")

</div>

Upload via import function. Then use crons to upload in the background as opposed to browser.
