# Basic Question About CRON jobs

**URL:** <https://forum.mautic.org/t/basic-question-about-cron-jobs/20933>\
**Category:** Product Support\
**Tags:** mautic-3\
**Created:** [September 20, 2021, 11:09am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933 "2021-09-20T11:09:52Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacktkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zacktkp/32/587_2.png) [@zacktkp](https://forum.mautic.org/u/zacktkp)\
**Post date:** [September 20, 2021, 11:09am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/1 "2021-09-20T11:09:52Z")

</div>

**Your software**  
My Mautic version is: 3.3.4  
My PHP version is: 7.3  
My Database type and version is:

**Your problem**  
My problem is:

Hi Guys… newbie in this arena.  
I used A2 hosting and installed Mautic with Softaculous.  
I created an addon domain for my Mautic. Set up the cron jobs:  
/addon.com/bin/console mautic:segments:update

received email with the title:  
Cron \<\*\*\*_ **\> /home/** _/addon.com/bin/console mautic:email:fetch

email content:  
/bin/bash: /home/\*\*\*\*\*\*\*/addon.com/bin/console: Permission denied

may I know what is it that i need to edit or rectify to get the cron jobs working?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 20, 2021, 6:38pm UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/2 "2021-09-20T18:38:10Z")

</div>

Who sent you that email in question? Is that A2 support?

---

<div class="post-metadata">

**Author:** ![zacktkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zacktkp/32/587_2.png) [@zacktkp](https://forum.mautic.org/u/zacktkp)\
**Post date:** [September 21, 2021, 3:34am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/3 "2021-09-21T03:34:29Z")

</div>

the mails are from From: (Cron Daemon)](mailto:\*\*\*\*\*\*@sg1-ts5.a2hosting.com)

the receiving mail account is the default mail account created by A2 for my hosting package.  
The mail was not received by any of the sub domain email account or admin email account.

---

<div class="post-metadata">

**Author:** ![zacktkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zacktkp/32/587_2.png) [@zacktkp](https://forum.mautic.org/u/zacktkp)\
**Post date:** [September 21, 2021, 3:38am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/4 "2021-09-21T03:38:10Z")

</div>

similar emails were received for all the cron jobs created.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 21, 2021, 5:12am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/5 "2021-09-21T05:12:00Z")

</div>

Run cronjob as web server user (typically www-data) user, I thin that is the simplest solution here

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 21, 2021, 6:34am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/6 "2021-09-21T06:34:52Z")

</div>

Probably you turned on cron job execution notifications.  
What is your exact command?  
“bin/bash” doesn’t look good. It should start with “php”.

---

<div class="post-metadata">

**Author:** ![zacktkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zacktkp/32/587_2.png) [@zacktkp](https://forum.mautic.org/u/zacktkp)\
**Post date:** [September 21, 2021, 7:02am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/7 "2021-09-21T07:02:43Z")

</div>

/home/×××××××/marketing.xxxxxxxx.site/bin/console mautic:segments:update

This is one of the sample commands as suggested by A2…

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 21, 2021, 7:59am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/8 "2021-09-21T07:59:05Z")

</div>

Hello,  
The command should have something like **php** in front.

---

<div class="post-metadata">

**Author:** ![zacktkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zacktkp/32/587_2.png) [@zacktkp](https://forum.mautic.org/u/zacktkp)\
**Post date:** [September 21, 2021, 8:22am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/9 "2021-09-21T08:22:18Z")

</div>

I added “php” to the front of the command and received emails with content as follow:

Mautic 3.3.4 - app/prod (kernel: app, env: prod, debug: false)

Usage:  
command [options] [arguments]

Options:  
-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

Available commands:  
about Displays information about the current project  
help Displays help for a command  
list Lists commands  
assets  
assets:install Installs bundles web assets under a public directory  
bazinga  
bazinga:oauth-server:clean Clean expired tokens  
cache  
cache:clear Clears the cache  
cache:pool:clear Clears cache pools  
cache:pool:prune Prunes cache pools  
cache:warmup Warms up an empty cache  
config  
config:dump-reference Dumps the default configuration for an extension  
debug  
debug:autowiring Lists classes/interfaces you can use for autowiring  
debug:config Dumps the current configuration for an extension  
debug:container Displays current services for an application  
debug:event-dispatcher Displays configured listeners for an application  
debug:form Displays form type information  
debug:router Displays current routes for an application  
debug:swiftmailer Displays current mailers for an application  
debug:translation Displays translation messages information  
debug:twig Shows a list of twig functions, filters, globals and tests  
doctrine  
doctrine:cache:clear-collection-region Clear a second-level cache collection region  
doctrine:cache:clear-entity-region Clear a second-level cache entity region  
doctrine:cache:clear-metadata Clears all metadata cache for an entity manager  
doctrine:cache:clear-query Clears all query cache for an entity manager  
doctrine:cache:clear-query-region Clear a second-level cache query region  
doctrine:cache:clear-result Clears result cache for an entity manager  
doctrine:cache:contains Check if a cache entry exists  
doctrine:cache:delete Delete a cache entry  
doctrine:cache:flush [doctrine:cache:clear] Flush a given cache  
doctrine:cache:stats Get stats on a given cache provider  
doctrine:database:create Creates the configured database  
doctrine:database:drop Drops the configured database  
doctrine:database:import Import SQL file(s) directly to Database.  
doctrine:ensure-production-settings Verify that Doctrine is properly configured for a production environment  
doctrine:fixtures:load Load data fixtures to your database  
doctrine:generate:entities [generate:doctrine:entities] Generates entity classes and method stubs from your mapping information  
doctrine:mapping:convert [orm:convert:mapping] Convert mapping information between supported formats  
doctrine:mapping:import Imports mapping information from an existing database  
doctrine:mapping:info  
doctrine:migrations:diff [diff] Generate a migration by comparing your current database to your mapping information.  
doctrine:migrations:dump-schema [dump-schema] Dump the schema for your database to a migration.  
doctrine:migrations:execute [execute] Execute a single migration version up or down manually.  
doctrine:migrations:generate [generate] Generate a blank migration class.  
doctrine:migrations:latest [latest] Outputs the latest version number  
doctrine:migrations:migrate [migrate] Execute a migration to a specified version or the latest available version.  
doctrine:migrations:rollup [rollup] Rollup migrations by deleting all tracked versions and insert the one version that exists.  
doctrine:migrations:status [status] View the status of a set of migrations.  
doctrine:migrations:up-to-date [up-to-date] Tells you if your schema is up-to-date.  
doctrine:migrations:version [version] Manually add and delete migration versions from the version table.  
doctrine:query:dql Executes arbitrary DQL directly from the command line  
doctrine:query:sql Executes arbitrary SQL directly from the command line.  
doctrine:schema:create Executes (or dumps) the SQL needed to generate the database schema  
doctrine:schema:drop Executes (or dumps) the SQL needed to drop the current database schema  
doctrine:schema:update Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata  
doctrine:schema:validate Validate the mapping files  
fos  
fos:oauth-server:clean Clean expired tokens  
fos:oauth-server:create-client Creates a new client  
lint  
lint:twig Lints a template and outputs encountered errors  
lint:xliff Lints a XLIFF file and outputs encountered errors  
lint:yaml Lints a file and outputs encountered errors  
mautic  
mautic:assets:generate Combines and minifies asset files from each bundle into single production files  
mautic:broadcasts:send Process contacts pending to receive a channel broadcast.  
mautic:cache:clear Clears Mautic’s cache  
mautic:campaigns:execute Execute specific scheduled events.  
mautic:campaigns:rebuild [mautic:campaigns:update] Rebuild campaigns based on contact segments.  
mautic:campaigns:trigger Trigger timed events for published campaigns.  
mautic:campaigns:validate Validate if a contact has been inactive for a decision and execute events if so.  
mautic:citrix:sync Synchronizes registrant information from Citrix products  
mautic:contacts:deduplicate Merge contacts based on same unique identifiers  
mautic:custom-field:create-column Create custom field column in the background  
mautic:donotsell:download Fetch remote do not sell list from MaxMind  
mautic:email:fetch [mautic:emails:fetch] Fetch and process monitored email.  
mautic:emails:send Processes SwiftMail’s mail queue  
mautic:import Imports data to Mautic  
mautic:install Installs Mautic  
mautic:install:data Installs Mautic with sample data  
mautic:integration:fetchleads [mautic:integration:synccontacts] Fetch leads from integration.  
mautic:integration:pipedrive:fetch Pulls the data from Pipedrive and sends it to Mautic  
mautic:integration:pipedrive:push Pushes the data from Mautic to Pipedrive  
mautic:integration:pushleadactivity [mautic:integration:pushactivity] Push lead activity to integration.  
mautic:integrations:sync Fetch objects from integration.  
mautic:iplookup:download Fetch remote datastores for IP lookup services that leverage local lookups  
mautic:maintenance:cleanup Updates the Mautic application  
mautic:max-mind:purge Purge data connected to MaxMind Do Not Sell list.  
mautic:messages:send [mautic:campaigns:messagequeue|mautic:campaigns:messages] Process sending of messages queue.  
mautic:plugins:reload [mautic:plugins:install|mautic:plugins:update] Installs, updates, enable and/or disable plugins.  
mautic:queue:process Process queues  
mautic:reports:scheduler Processes scheduler for report’s export  
mautic:segments:check-builders Compare output of query builders for given segments  
mautic:segments:update [mautic:segments:rebuild] Update contacts in smart segments based on new contact data.  
mautic:social:monitoring Looks at the records of monitors and iterates through them.  
mautic:theme:json-config Converts theme config to JSON from PHP  
mautic:transifex:pull Fetches translations for Mautic from Transifex  
mautic:transifex:push Pushes Mautic translation resources to Transifex  
mautic:translation:debug Displays translation messages informations  
mautic:unusedip:delete Deletes IP addresses that are not used in any other database table  
mautic:update:apply Updates the Mautic application  
mautic:update:find Fetches updates for Mautic  
mautic:webhooks:process Process queued webhook payloads  
oneup  
oneup:uploader:clear-chunks Clear chunks according to the max-age you defined in your configuration.  
oneup:uploader:clear-orphans Clear orphaned uploads according to the max-age you defined in your configuration.  
router  
router:match Helps debug routes by simulating a path info match  
security  
security:encode-password Encodes a password.  
social  
social:monitor:twitter:hashtags Looks at our monitoring records and finds hashtags  
social:monitor:twitter:mentions Searches for mentioned tweets  
swiftmailer  
swiftmailer:email:send Send simple email message  
swiftmailer:spool:send Sends emails from the spool  
translation  
translation:update Updates the translation file  
X-Powered-By: PHP/7.3.30  
Content-type: text/html; charset=UTF-8

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 21, 2021, 11:32am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/10 "2021-09-21T11:32:16Z")

</div>

@zacktkp

Here are instructions on how to setup cronjobs: [Cron jobs | Mautic](https://docs.mautic.org/en/setup/cron-jobs)

Also since you are dealing with cronjobs here I would suggest providing absolute path to php command (in front of each command). You can find out what the absolute path is, by typing `whereis php`

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 21, 2021, 11:57am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/11 "2021-09-21T11:57:00Z")

</div>

You are on the right track.

You probably ran this:

/home/×××××××/marketing.xxxxxxxx.site/bin/console

You need to add the ending too.

php /home/×××××××/marketing.xxxxxxxx.site/bin/console mautic:segments:update

It should be fine.

---

<div class="post-metadata">

**Author:** ![zacktkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zacktkp/32/587_2.png) [@zacktkp](https://forum.mautic.org/u/zacktkp)\
**Post date:** [September 21, 2021, 1:42pm UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/12 "2021-09-21T13:42:41Z")

</div>

hi [mzagmajster]

Am still learning big time…  
after using “whereis php”, I got the path as “/usr/local/bin/php”. Am I right to say that I should just use this exact path? Or do I need to replace any part of the path?

---

<div class="post-metadata">

**Author:** ![zacktkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zacktkp/32/587_2.png) [@zacktkp](https://forum.mautic.org/u/zacktkp)\
**Post date:** [September 21, 2021, 1:46pm UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/13 "2021-09-21T13:46:42Z")

</div>

Hi joeyk,

Thanks for your patient with me. Actually, I added ending for all the cron jobs.  
Will try to run the cron jobs again and see how things turn out. Will seek more assistance here when the need arise.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 21, 2021, 1:58pm UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/14 "2021-09-21T13:58:43Z")

</div>

Yes use the path you got to call the script, so something like:

/usr/local/bin/php /home/×××××××/marketing.xxxxxxxx.site/bin/console mautic:segments:update

---

<div class="post-metadata">

**Author:** ![zacktkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zacktkp/32/587_2.png) [@zacktkp](https://forum.mautic.org/u/zacktkp)\
**Post date:** [September 21, 2021, 2:29pm UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/15 "2021-09-21T14:29:09Z")

</div>

thanks a lot… will try that out also…😃 hope it can solve all the issues…😃

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 22, 2021, 6:36am UTC](https://forum.mautic.org/t/basic-question-about-cron-jobs/20933/16 "2021-09-22T06:36:02Z")

</div>

Once you ‘solve it’ it will be time to optimize:

[![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/97e2e776c3a3881b387dcfc0c7809b2d55e67d45.jpeg "Mautic Cron Jobs - MMLagos October 2020") ](https://www.youtube.com/watch?v=bQ9WrgWNLVQ)
