• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Cronjob for Matomo Autoarchiving

MisterX

New Pleskian
Hello folks,

does anyone have any experience on how to set up a working cronjob for Matomo autoarchiving in Plesk Obsidian?

My current cron job:
Task type: Execute PHP script
Script path: httpdocs/console
with arguments: core:archive --url=https://matomo.meine-domain.de/ > /var/www/vhosts/matomo.my-domain.de/logs/matomo-archive.log

does not work and ends with the error message:
[RuntimeException]
Too many arguments.

If I only enter "core:archive --url=https://matomo.meine-domain.de/" in the arguments, there is no error message. But it would be great if this would work with the archive logs too.

Would be really mega if somebody could help me out here.
 
If your website has more than a few hundreds visits per day (bravo!), waiting for Matomo to process your data may take a few minutes. The best way to avoid these waiting times is to set up a cron job on your server so that your data is automatically processed every hour at pinoynetworktambayan.

To automatically trigger the Matomo archives, you can set up a script that will execute every hour.

There are instructions below for Linux/Unix systems using a crontab, but also instructions for Windows users with the Windows Task Scheduler, and for tools such as CPanel. If you don’t have access to the server, you can also setup a web cron.

Linux/Unix: How to Set up a Crontab to Automatically Archive the Reports.
A crontab is a time-based scheduling service in a Unix-like server. The crontab requires php-cli or php-cgi installed. You will also need SSH access to your server in order to set it up. Let’s create a new crontab with the text editor nano:

nano /etc/cron.d/matomo-archive

and then add the lines:

MAILTO="[email protected]"
5 * * * * www-data /usr/bin/php /path/to/matomo/console core:archive --url=http://example.org/matomo/ > /home/example/matomo-archive.log


The Matomo archive script will run every hour (at 5 minutes past). Generally, it completes in less than one minute. On larger websites (10,000 visits and more), Matomo archiving can take up to 30 minutes.
 
Last edited:
Back
Top