Today, I upgraded to v5.1.0 and after running a system check, I had the following error in the System Check Results:
Archiving last ran successfully on Tuesday, April 2, 2024 2:59:04 PM which is 122 days 05:00:10 ago.
Please check that you have setup a crontab calling the core:archive console command, and that you have configured a MAILTO to receive errors by email if archiving fails.
You can also try to run the console command to archive your reports manually:
/path/to/console --matomo-domain=your.domain.here core:archive
I’m not sure if the CRON command changed at some point and I just missed it, but the old CRON I had set was as follows:
/opt/cpanel/ea-php81/root/bin/php -q /home/path/to/console core:archive --url=https://your.domain.here/ > /home/path/to/matomo-archive.log
The Website [link] states:
- Log in to CPanel for the domain with the Matomo installation
- Click on “Cron Jobs”
- Leave email blank
- In ‘Minutes’ put 00 and leave the rest blank.
- You then need to paste in the path to the PHP executable, then the path to the Matomo /console script, then the parameter with your Matomo base URL
--
url=matomo.example.org/
Here is an example for a Hostgator install (in this example you would need to change ‘yourcpanelsitename’ to whatever your particular domains cpanel username is)
/usr/local/bin/php -f /home/yourcpanelsitename/public_html/matomo/console core:archive --url=example.org/matomo/ > /home/example/matomo-archive-output.log
However, I was getting the following error in the log file:
Uncaught exception:… The “
--
url” option does not exist. [Query: , CLI mode: 1]
I was able to get CRON to run using the Web CRON, but not CRON directly.
Finally, I noticed the " --matomo-domain=your.domain.here" in the above entry from the System Check Page and updated my CRON to:
/usr/local/bin/php -f /home/yourcpanelsitename/public_html/matomo/console core:archive --matomo-domain=https://example.org/matomo/ > /home/example/matomo-archive-output.log
and it was finally working again!
Hopefully this may be useful to others as well.