Question

my pub/media/captcha/base directory of Magento 2 has over 500k images!

This causes the server's inodes to become overloaded.

So I know that these images would be deleted every 10 minutes, but this don't work for me.

I search for a cron command to delete these captcha images... Can you help me please?

Thanks!

P.S: I've red other related posts but I can't find any working solution.

Was it helpful?

Solution

You should be able to see which is the cron identifier if you install https://github.com/netz98/n98-magerun2 and run the command n98-magerun sys:cron:list. Obviously, the cron should have something related to deleting expired captcha in the name.

Once you found the identifier, you can execute it individually by running n98-magerun sys:cron:run <identifier>.

Good luck!


LE

The related crons can be executed like this:

n98-magerun sys:cron:run captcha_delete_expired_images
n98-magerun sys:cron:run captcha_delete_old_attempts

without the n98 tool, you are not able to run an individual cron command on its own outside Magento's cron management (which you mentioned is not working for you? check this also https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html maybe there is some misconfiguration somewhere).

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top