Can we tell archive cron job to exclude certain sites or periods?

We have a cron process to run archiving every hour:

/usr/local/bin/php -d memory_limit=1G -f /home/sitestats/public_html/analytics/console core:archive --url=123sitestats.com/analytics/

For Background info: We’ve been getting the memory allocation error, so we followed the steps on this page https://matomo.org/docs/setup-auto-archiving/#increase-php-memory-limit and found out we needed to override the memory limit in the command:

-d memory_limit=1G

Unfortunately, due to hosting limitations, 1G is the highest we can go. This solves the error for most reports, but one still gets errors: We have a roll-up that includes 16 sites (ID 44), and the error appears for the “year” period:

Error: Got invalid response from API request: ?module=API&method=API.get&idSite=44&period=year&date=last7&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:308:"Allowed memory size of 1073741824 bytes exhausted (tried to allocate 4096 bytes) on /home/sitestats/public_html/analytics/core/DataTable.php(1377) #0 /home/sitestats/public_html/analytics/core/ArchiveProcessor/PluginsArchiver.php(173): 123 Site Stats\Plugins\CustomReports\Archiver->callAggregateMultipleReports() ";}a:2:{s:6:"result";s:5:"error";s:7:"message";s:308:"Allowed memory size of 1073741824 bytes exhausted (tried to allocate 4096 bytes) on /home/sitestats/public_html/analytics/core/DataTable.php(1377) #0 /home/sitestats/public_html/analytics/core/ArchiveProcessor/PluginsArchiver.php(173): 123 Site Stats\Plugins\CustomReports\Archiver->callAggregateMultipleReports() ";}'

This isn’t a huge problem for us, because we only regularly use the month-long reports. However, since the archiving runs once an hour, our logs are constantly filling up with this error. Is there a way we can tell our cron job to ignore/exclude site id 44, and/or the “year” period?

Hi,

So far I know you can exclude site but it will be excluded for all periods . You may think to, do not archive year period for all sites at all and I think this setting can be found in matomo global.ini file .