HALF SOLVED: Good cron command line, nothing with cronjob

Running cron jobs as root is best avoided where possible, if only from a “minimise risk” perspective.

Here’s what I would do:

  • The >/dev/null near the end of each cron line means “discard any output from this command”. The 2>&1 means “send any errors to the same place as the other output”. In other words, all information, errors, warnings, etc, are being lost. The first thing I’d do is remove >/dev/null 2>&1 from the end of every cron line.
  • Those commands should run as the web user, but the actual username will depend upon which Linux distribution you are using. For example, on Debian and Ubuntu, it’s www-data by default, but it could be different on your system. Find out what username your web server runs under. If you need help to do that, ask .
  • Switch to the web server user. For simplicity, let’s assume that’s www-data:
    su -s /bin/bash www-data
    That says “switch user, with /bin/bash as the shell, to user www-data”
  • Try to run your cron command. For example:
    /usr/bin/ea-php72 /home/xxxxxx/public_html/xxxxxx/app/console mautic:emails:send
    That will probably fail, but it should output some useful information. Copy and paste that here if you’re not sure what to do next.

hth,
Keith