Skip to content

Instantly share code, notes, and snippets.

@mattattui
Created November 11, 2014 11:58
Show Gist options
  • Save mattattui/16a76cd162d0d5e2b9b1 to your computer and use it in GitHub Desktop.
Save mattattui/16a76cd162d0d5e2b9b1 to your computer and use it in GitHub Desktop.
Symfony2 mac cache-clearing/permission script
#!/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