Cronjobs for Mautic in HestiaCP? how i can do it?

Good morning, sorry because my first post is to ask for help, but I’ve been doing this for 3 days, and I don’t know what I’m doing now. Before continuing, excuse my English, I don’t know how to speak it and I use a translator.

My knowledge is basic I would say, I have been using VestaCP for years and several months using HestiaCP, I love the latter and everything they have done. I use them to host websites with Wordpress, and landing pages. So far everything is going great.

I also plan to be an evangelist for Hestia CP, in truth I have not seen anything better, and in the future I plan to show its benefits in tutorials and courses with what I learn to do, both on YouTube and on my websites, in Spanish there is still no a lot of information.

Let’s get to the problem … hehe.

My goal is to have Mautic on a more or less decent VPS * (10 to 15 dollars), and from there to implement email marketing strategies, and various news letters, in conjunction with Amazon SES. In the same order, I plan to learn to do it in the correct way, and as efficient as possible both in terms of security and resources, and then teach it on YouTube, obviously in Spanish.

Now I am following a mini course, where everything is explained but with Plesk. I have even thought of using only Plesk to do that project with Digital Ocean, since they allow me three sites for free, and only one site would be enough, and if I don’t find a solution I will probably do that, I already have a VPS server with Plesk and 100% Mautic I just need to implement Amazon SES, obviously I am doing tests as I am learning.

My other objective was to implement everything that the course that I am following tells me, but with Hestia CP, and I found a problem, or at least I think so.

And they are the cronjobs. That once I understand it will surely be super easy, but excuse me, I am a newbie. And Mautic necessarily needs cronjobs to work.

Until now I don’t even know if it is working, because it does not throw me any error or receive any report, contrary to my tests done in Plesk where I can do a check and it tells me if it is ok or not. * (This is an idea for developers, that allows me to check if everything is ok with a button, similar to Plesk would be great)

This long introduction to ask this:

1. How can I check via console or wherever, if a cron job works correctly

I have searched several sites, I have used:

To check the cron job log for a specific user use in the terminal
cat / var / log / cron | grep MYUSERNAME

It does not work.

check the cron jobs with the command crontab -u username -l

Yes, it works and it gives me a result, but it only shows me the crobjobs, it does not tell me if there is an error, or if everything is fine.

2- I need to install the Mautic cronjobs for it to work, and they are these: How can I do it?

I’ve given you the Mautic documentation, which is this:

They recommend at least three cronjobs commands, and they even give a guide, but I repeat in case I do not explain well, I still do not know if they work on my site, because it does not throw me any error or anything.

Mautic recommends this format for cronjob:

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

I used it myself, then I looked for a way to check if it worked correctly and I read I do not remember where that by putting this command in the terminal I could know if it worked or not, well, I did, but in the terminal as root user and also as admin * (I do not use the admin user to create websites, for security, but this is a test), it does not throw me anything in the terminal, that is, neither a is good nor an error nor anything.

I use this:

php -q /home/MYUSER/web/mautic.MIDOMAIN.xyz/public_html/bin/console mautic: segments: update

I am using a subdomain as you can see.

I apologize for being so long, but I want to explain well what happens to me, and surely many of you understand me in two or three lines.

So far I have thought two things:

  1. Everything is fine, and I can continue the course.
  • (That is why I have searched multiple sites for how to check if it is working and I try everything, and nothing tells me if it is working or not)
  1. Or nothing works, and when I go to integrate an SMTP server it will give me errors.

Excuse me, I’m learning.

the cron daemon logs its output to /var/log/syslog so your cat/grep command won’t yield any result.

I recommend to not just blindly run commands you might google or read somewhere. they could even be malicious. maybe do a basic linux system administration course first, to understand how to find files you are looking for or how to evaluate if the commans you read about on the internet are good for your use case.

being a Newbie is totally fine, put please understand that HestiaCP is not intended to be a newbie friendly tool but rather wants to help more seasoned admins with recurring tasks. it tries to not bind itself too deep into the system to allow custom setups more easily (which would be much harder with e.g. plesk) - hence we expect you to know some stuff or you won’t have much fun with Hestia.

for the issue at hand please check your syslog. also simply run your php/cron commands with the correct user manually from cli to see some output. or redirect the output within the cron call to any own logilfe in the userdir…
also check mautic itself. I am not familiar with it, but other tools that make use of crons like f.i. shop systems or next/owncloud will usually show within the admin area somewhere if and when the last cron succeeded.

best of luck!

Thank you very much for your advice.

The solution is: remove the letters “php” in the cronjob, and leave it like this:

/home/YOURUSER/web/yoursubdomain.YOURDOMAIN.com/public_html/bin/console mautic: segments: update

If you don’t use a subdomain, it is simply:

/home/YOURUSER/web/YOURDOMAIN.com/public_html/bin/console mautic: segments: update

And regarding the execution times, Mautic has a guide to do it, but basically it is to put every 5, 10, 15, 20, etc … minutes, it depends on the cronjob.

I recommend creating another user to create any website or application within hestia, we should not use the admin user.

Goodday.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.