I want to deploy a magento site. But firstly I need to clear temp/cache files from magento directory as well as database.

I don't know how to do both by a single script.

Note :- Need to remove only temp files from directory and database.

1 Answer 1


Well you need to look at my gist here, it contains code for clearing the log, cache and temp in both files and database.

Download it from:


Hope this works for you

  • There is no file on your link.
    – zus
    Nov 13, 2017 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.