cleanup Magento cache and restore the permission

It can be used to restore the file permission to 644 mode