Skip to content

Instantly share code, notes, and snippets.

@joostvanveen
Created April 25, 2018 11:20
Show Gist options
  • Save joostvanveen/0342f3cd1fa526a94d6ba558b68e50b0 to your computer and use it in GitHub Desktop.
Save joostvanveen/0342f3cd1fa526a94d6ba558b68e50b0 to your computer and use it in GitHub Desktop.
Clean old product images cache and orphaned product images for Magento 1
# Delete all cached images older than 365 days
find ~/public/media/catalog/product/cache/* -type f -atime +365 -exec rm {} \;
# Remove product images that are not present in the database
magerun media:images:removeorphans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment