How do I use the cyberpanel cron job?

September 16, 2019 232 views
PHP Ubuntu 18.04

Hello

I doubt cyeberpanel’s Cron Jobs

I’m trying to set up the Mautic 2.15 cron job on Cyberpanel

not work
/usr/local/lsws/lsphp72/bin/php /home/roupasatacado.vendamais.xyz/public_html/app/console mautic:campaigns:trigger

not work
/home/roupasatacado.vendamais.xyz/public_html/app/console mautic:campaigns:trigger

How do I use the cyberpanel cron job?

I installed Cyberpanel with one click (marketplace) DigitalOcean

Ubuntu 18
Cyberpanel
PHP 7.2

tks

2 Answers

Hi @administrador28c2b826ad7c0,

I’ve checked the mautic documentation here - Article. It seems you need to do the following

php /path/to/mautic/app/console mautic:campaigns:trigger --env=prod

It seems your path and exact command seem to be correct. This would mean you are not calling PHP properly. To find the exact path, you can try

whereis php

From there, you can get the exact php path and set the cron job. Don’t forget to add the execution time as well.

Kind regards,
Kalin

@KFerdinandov

In this case, the path is correct. But I am not sure if he runs the command directly via CLI it runs or not.

First, need to make sure that this command does not have any problem running via CLI.

And for more details on cron job, you can see my answer on CyberPanel forums -> https://forums.cyberpanel.net/discussion/comment/6187/#Comment_6187

  • The crons in CyberPanel are located and executed the same way as on other Unix systems. If he can actually run the program via the command line, it should be fine to be put on a cron job.

    It’s possible the hours to be executed haven’t been configured properly or there is a typo.

Have another answer? Share your knowledge.