How do I find my compute engine path and how to set up the cron for a Mautic instance?

Your software
My Mautic version is: 3.02
My PHP version is: 723

Your problem
I want to set cron jobs for my Mautic install, but I don’t know what path to use …

Mautic install is over here:

http://35.233.141.211/s/login

I don’t know where the cron file is located, and I don’t know the path to use inside the cron file commands.

Cron command for mautic looks like this on Bitnami mautic cloud instance:

1 * * * * su daemon -s /bin/sh -c “/opt/bitnami/php/bin/php -q /opt/bitnami/apps/mautic/htdocs/app/console mautic:segments:update

And mautic documentation says path like this:

php /path/to/mautic/bin/console mautic:campaigns:update

So to summarize

1.What is the path to my mautic installation
2.In what file should I put the cron code or where should I create a new file?
3.What path should I enter into the mautic cron job command

bitnami is a package application manager, so, it took care of the installation and stored it in /opt/bitnami/apps/mautic/htdocs directory, which is your /path/to/mautic

The /app/console is wrong for mautic 3, it should be /bin/console, so do this:

1 * * * * su daemon -s /bin/sh -c “/opt/bitnami/php/bin/php -q /opt/bitnami/apps/mautic/htdocs/bin/console mautic:segments:update

That is just an example, php can be installed in a couple of places depending on the environment, and how it is installed

Wherever the bitnami cloud instance puts the cron code.

1 Like

Thanks, but actually I didn’t use Bitnami version, because there is a bug with it now, since mid september, can’t use email builder…

So I used Google deploy, I was able to get in with filezilla, here is some info, maybe you can tell what path I should input in there?

First command to run is:

gcloud beta compute ssh --zone “us-west1-a” “mautic-google-deploy-vm” --project "horizon-private-charters"

Then it takes me to here:

root@mautic-google-deploy-vm:~#

Filezilla says the console file is here (I think…)

/var/www/html/mautic/bin

Here are images:

Oh, I see, your directory is here

/var/www/html/mautic/

So, you do something like this in the crontab:

php /var/www/html/mautic/bin/console mautic:campaigns:update

2 Likes

Thanks, almost there…but still confused, not sure what exact code to put in there…

Siteground hosting:
15 * * * * /usr/local/bin/php /home/vuxi5632/public_html/brunovincent.net/mautic_yh/bin/console mautic:campaigns:update >/dev/null 2>&1

Bitnami Documentation
15 * * * * su daemon -s /bin/sh -c "installdir/php/bin/php installdir/apps/mautic/htdocs/app/console mautic:segments:update --env=prod"

Mautic forum post suggestion:
1 * * * * su daemon -s /bin/sh -c “/opt/bitnami/php/bin/php -q /opt/bitnami/apps/mautic/htdocs/app/console mautic:segments:update” #mautic-segments-cron

Google Cloud:
Not sure, but I have these 3 bits of information:

I ran this command in command prompt:
~# grep -i 'DocumentRoot' /etc/apache2/sites-available/000-default.conf

And I got this:
/var/www/html/mautic

My IP address is this:
http://35.233.141.211/s/dashboard

My Google cloud sign in comand is this:
gcloud beta compute ssh --zone "us-west1-a" "mautic-google-deploy-vm" --project "horizon-private-charters"

Command prompt path on my windows PC:
root@mautic-google-deploy-vm:~#

What is the EXACT code in need to input into the file?

I tried this:

0,15,30,45 /usr/local/bin/php /var/www/html/mautic/bin/console mautic:segments:update >/dev/null 2>&1
5,20,35,50 /usr/local/bin/php /var/www/html/mautic/bin/console mautic:campaigns:update >/dev/null 2>&1
10,25,40,55 /usr/local/bin/php /var/www/html/mautic/bin/console mautic:campaigns:trigger >/dev/null 2>&1
1,2,3,4,5,6,7,8,9,10,59 /usr/local/bin/php /var/www/html/mautic/bin/console mautic:emails:send >/dev/null 2>&1

But I get this error:

"/tmp/crontab.UHFBk0/crontab":23: bad hour
errors in crontab file, can't install.

What editor are you using to edit the crontab?

1 Like

Nano, been fighting with this for days, stackoverflow, facebook forums, name it…(

I’m getting discouraged…

you seem like you know what you are doing, can i give you my google cloud username and password, then you can login and find the path?

Even google Suite support can’t help me…!

php /home/domain.com/public_html/bin/console mautic:iplookup:download > /dev/null 2>&1 is what my path looks like

do you have just ssh acces or do you have a control panel installed?

1 Like

This is on Google cloud computer engine, not as simple as a plain website on a server…;(

Why don’t you get a good webserver for $10-$20 / month by linode for example?
You’ll save a bunch of headache for yourself.

2 Likes

I might very well just do that!

But I got it figured out now devsrealm was right as usual, I just had the syntax wrong, for others out there, the Google Cloud console path is actually very simple, not like the Bitnami one…

this worked:

36,38,39,44,45 * * * * php /var/www/html/mautic/bin/console mautic:emails:send >/dev/null 2>&1

[SOLVED] by devsrealm

1 Like