• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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