Skip to content

Instantly share code, notes, and snippets.

@Webmasterei
Created February 5, 2016 10:40
Show Gist options
  • Save Webmasterei/e7271902769dd07f36dc to your computer and use it in GitHub Desktop.
Save Webmasterei/e7271902769dd07f36dc to your computer and use it in GitHub Desktop.
Script to delete Magento Cache that is older than...
#!/bin/sh
MAGENTOROOT="htdocs"
### Delete Frontpage Cache that is older than one day. ###
find $MAGENTOROOT/var/cache/fpc* -type f -mmin +3600 -exec rm {} \;
### Delete Magento Caches that are older than 120min ###
find $MAGENTOROOT/var/cache/mage* -type f -mmin +120 -exec rm {} \;
#### Delete repotrts older than 7 days ###
find $MAGENTOROOT/var/report/ -mtime +7 -exec rm -f {} \;
#### Delete session data (should be the same time as session cookie time) ###
find $MAGENTOROOT/var/report/ -mmin +120 -exec rm -f {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment