Mautic Cron Jobs Issue & NOT Able to Send Any Campaigns

Your software
My Mautic version is: 3.1.1
My PHP version is: 7.4.10

Your problem
I have installed Mautic on my Digital Ocean VPS within Linux Ubuntu. But I cannot get my cron jobs to run any campaign tests. Mautic will NOT send any campaigns, only test emails.

I did not install in the usual directory which seems to be:

Instead, I have installed inside of the main directory of my website (not on a subdomain) as shown in the image below:

I have tried setting up the proper cron jobs located in the following directories or as shown in the image below:

My “cron-jobs.txt” file is located in the following directory:

and looks like what is shown in the image below:

I would appreciate it if someone could further guide me in the right direction with ensuring that I have set up the correct cron jobs and file path directories. Thanks.

Replace all the /apps/console to /bin/console

That is not a cron job, it might have been place there for reference

Okay, so I changed to the recommended path, but it still won’t send campaigns. Any other ideas of what could be missing? Please check the image below:

Why are u editing the cron tab manually, this is a bad practice, but you should be fine if you know what you are doing.

Remove the -q option and try again

remove the console.php
for example: your-mautic-install/bin/console mautic:campaigns:trigger

here is one of mine complete

/opt/plesk/php/7.3/bin/php /var/www/vhosts/mauticinstall/bin/console mautic:campaigns:trigger
I copy/past that in an SSH and bam-

Im running Centos 7 - plesk panel so there will be variances

1 Like

Please run your cron commands in ssh and past the result here.
Why am I saying that?
Because the error will show you:

  • your path to php is wrong
  • your php path is fine, but your mautic path is not okay
  • both are fine, but there is something wrong with you r campaign settings (you forgot to publish one part of your campaign)
1 Like

I try to edit the crontab file to create con jobs by using ssh “sudo crontab -e” and “crontab -e”, but I keep getting the following error message (or as shown in the image below):

And the file path location " /var/spool/cron/crontabs/ " folder is empty. Shouldn’t there be a cron file of some type to edit?

So what I’m trying to do is create cron jobs to handle my Mautic cron tasks/jobs as shown below:

php /var/www/ mautic:segments:update

php /var/www/ mautic:campaigns:update

php /var/www/ mautic:campaigns:trigger

php /var/www/ mautic:iplookup:download

php /var/www/ mautic:broadcasts:send

php /var/www/ mautic:maintenance:cleanup --days-old=60 --no-interaction

Do I need to somehow reinstall the crontab setup or how do I get back to being able to edit with nano? At this point I’m not able to edit the main crontab file & nor do I know where it is located.

Thanks for any support.

BTW, I tried to reinstall crontab and cron jobs, that’s when I started experiencing this error message.

Perhaps use the cron function in Cpanel or whatever is available for your VPS in the future.

There is no point in adding crons (by any method) until you have tested and verified the formatting by executing manually via SSH and observing the output as noted by @joeyk previously.

Here is an excellent discussion for reference

It was strangely conspicuous as the first result of a google search of “ubuntu crontab file location”

Your error shows ‘bad minute’ .
Maybe check if the format is correct. Did you add the timing? :slight_smile:

1 Like

Thanks brother! I actually realized it a while back, but thanks anyhow.