Does the cronjob mautic:maintenance:cleanup --days-old=90 remove old identified contacts?

Your software
My Mautic version is: 4.3.1
My PHP version is: 7.4
My Database type and version is: MariaDB: 10.3.32

Hi support,

Checking Mautic cronjobs I notice the following:

/opt/alt/php74/usr/bin/php /home/<account>/public_html/bin/console mautic:maintenance:cleanup --days-old=90 --dry-run

This command adds --dry -run at the end, which does not actually execute the action of the command but reports the affected records to be deleted after 90 days (or the set number of days, by default 365 days):

+------------------------------------+---------------------+
| Type of record                     | Registers concerned |
+------------------------------------+---------------------+
| Audit log entries                  | 3425094             |
| UTM Tag History                    | 67162               |
| User notifications                 | 6                   |
| User tokens                        | 1                   |
| Visitors                           | 829305              |
| Page views                         | 1380356             |
+------------------------------------+---------------------+

If I run this cronjob without --dry-run from terminal:

/opt/alt/php74/usr/bin/php /home/<account>/public_html/bin/console mautic:maintenance:cleanup --days-old=90

It informs me that this action will delete all data (records) after 90 days:

This will permanently delete the oldest 90 data! Please make a backup before proceeding. Run this command with --dry-run to get an approximate list of records to be deleted. Continue? (y/n) n

The question is:

Will this action (without --dry-run) remove all identified contacts, with email, older than 90 days (or the days set in the cronjob command) or only anonymous visitors?

What is the point of recommending --dry-run by default in the mautic:maintenance:cleanup cron if it is not run with this parameter interposed?

I would like to know what happens to the identified contacts after the specified days.

I look forward to hearing from you, thank you! :hugs:

Hi
It doesnt remove known contacts at all. Also doesnt remove unidentified contacts. It cleans operational data.

Dry run will show you what would be deleted.

1 Like

So what specific data does the mautic:maintenance:cleanup --days-old=XXdays cron run remove?

What is the operational data?

Thank you very much @joeyk :hugs:

Okay, im stupid. It does remove anonyms as well. Just see your table above

1 Like

Hi @joeyk

Thank you very much, I solve the “out of memory” problem after upgrading to 4.3.1 and try the cron without the --dry-run to see how it works.

PHP Fatal error: Out of memory (allocated 191889408) (tried to allocate 327680 bytes) in /home/<account>/public_html/vendor/symfony/translation/MessageCatalogue.php on line 88

Thanks for your constant support. :hugs: