Created
November 11, 2014 11:58
-
-
Save mattattui/16a76cd162d0d5e2b9b1 to your computer and use it in GitHub Desktop.
Symfony2 mac cache-clearing/permission script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir -p app/cache app/logs app/sessions | |
rm -rf app/cache/* | |
rm -rf app/logs/* | |
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` | |
sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs app/sessions | |
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs app/sessions | |
# Clear application caches, dump and install assets | |
app/console cache:clear --env=prod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment