How to add mautic cron job in plesk

Your software
My Mautic version is: 3.3.1
My PHP version is: 7.4
My Database type and version is:My Sql

Your problem
My problem is:

I need to run mautic cron job in plesk.

This is the command:

php /var/www/vhosts/example.com/httpdocs/mymautic/app/console mautic:segments:update

I tried running this command as it is but it is not working and I have also tried running /usr/ bin /php /var/www/vhosts/example.com/httpdocs/mymautic/app/console mautic:segments:update still it is not working because when I run a command on ssh /usr/ bin /php

I get the following output:
-bash: /usr/local/bin/php: No such file or directory

How do I run this cron job please help me resolve this issue…

@dollysingh197
add this to the beginning of your cron jobs right before php
/opt/plesk/php/7.4/bin/ if you run PHP 7.4
/opt/plesk/php/7.3/bin/ in you run PHP 7.3

Looks like this:
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/bin/console mautic:campaigns:update

1 Like

I will try this and update you if it works…

1 Like

@EJL This is not working…

Hey @EJL there was a mistake from my side that is why it was not working. I was using app/console instead of bin/console… So once I correct it. It started working…

Thank you so much for your help…

1 Like

Excellent. Here’s a pro tip. Copy it up to the “console” portion and paste to a Google doc about a dozen times. Then add the mautic:xxxx:xxx for the most frequent commands, the update commands, and whatever else is useful .

Here is a snippet of my cheat sheet (I use it daily)

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:update:find

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:update:apply --update-package=3.2.4-update.zip

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:update:apply --finish

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:segments:update --batch-limit 1000 -f -vvv --max-contacts 100

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:segments:rebuild --batch-limit 1 -f -vvv --bypass-locking

mautic:segments:update [-b|–batch-limit [BATCH-LIMIT]] [-m|–max-contacts [MAX-CONTACTS]] [-i|–list-id [LIST-ID]] [-f|–force] [–bypass-locking] [-t|–timeout TIMEOUT] [-x|–lock_mode LOCK_MODE] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:segments:rebuild --batch-limit 500 --list-id 196 -f -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:campaigns:update --batch-limit 1 -f -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:campaigns:rebuild -f -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:campaigns:trigger --batch-limit 100 -f -vvv --campaign-id 1

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:import --id 15726 -f -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:import:directory -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:import:parallel -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:emails:send

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:iplookup:download -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:emails:fetch -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:unusedip:delete

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:emails:send -f

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:segments:rebuild

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console cache:clear -vvv

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:plugins:update

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console swiftmailer:email:send

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console swiftmailer:spool:send --message-limit=10 --time-limit=10 --recover-timeout=900 --mailer=default

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:queue:process

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console doctrine:schema:update --force

/var/www/vhosts/example.com/app.example.com/mautic-2-backup-files/bin/console doctrine:schema:update --force

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console doctrine:schema:update --env=prod --force

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console doctrine:schema:validate

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console doctrine:migrations:migrate

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:migrations:generate

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:broadcasts:send --channel=sms

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:campaigns:messages --channel=sms

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:campaigns:validate

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:contacts:deduplicate

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:emails:fetch --message-limit 500

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console debug:swiftmailer

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console mautic:social:monitoring

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s

/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console -s
/opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/app.example.com/bin/console doctrine:schema:update --force

1 Like