by
0
5
3,047
1
Top 1% !
Famous
Easy-to-find
Specified
MultiPlatform
Popularity: 13602nd place
FrameworkMagento
LanguageBASH
LicenseMIT_X11
TechnologyMVC

Bash Script to clean magento 1.x Cache

Magento 1.x cache clean Bash script.
1. Save the code in "/path/of/the/file/<some_file_name>.sh" 
2. Give executable permission for the file "chmod a+x /path/of/the/file/<some_file_name>.sh"
3. Run the script from your magento document root like 
$ /path/of/the/file/<some_file_name>.sh
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1468532/Bash-Script-to-clean-magento-1-x-Cache?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
#!/bin/bash # author Shebin Sheikh # function to remove the magento cache. function mageCacheClear { local current_dir=$(pwd); #echo $current_dir #exit if [[ -f "$current_dir/app/Mage.php" ]]; then #echo "Inside Mage Doc root" rm -vrf var/{cache,full_page_cache}/ media/{js,css}/ else echo -e "Not inside A magento 1.X's document root!" exit $? fi } mageCacheClear # call the function
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus