I’ve installed Mautic (email program). It needs 3 cronjobs to run properly.
php /var/www/mydomainname/htdocs/app/console mautic:segments:update
php /var/www/mydomainname/htdocs/app/console mautic:campaigns:update
php /var/www/mydomainname/htdocs/app/console mautic:campaigns:trigger
I am on Ubuntu 18.04 and am using PHP 7.0x.
When I do sudo php /var/www/mydomainname/htdocs/app/console mautic:campaigns:trigger
, or any other of the 3 listed above, they work without problem. I get the correct output and it’s executed.
However, when I put the same commands in a crontab, nothing happens.
I’ve tried everything. In the root crontab, in the www-data crontab, in my user crontab, with absolute paths to the PHP7.0 command (in /usr/bin/php7.0
). Even tried first changing to the php
directory and whatnot.
For example:
* * * * * /usr/bin/php7.0 /var/www/mydomainname/htdocs/app/console mautic:segments:update
Or:
* * * * * sudo /usr/bin/php7.0 /var/www/mydomainname/htdocs/app/console mautic:segments:update
Or:
* * * * * cd /usr/bin sudo php7.0 /var/www/mydomainname/htdocs/app/console mautic:segments:update
Nothing does the trick when using crontab.
Anyone know why?
journalctl -eu cron.service
).