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.

Revisions

  1. mattattui created this gist Nov 11, 2014.
    13 changes: 13 additions & 0 deletions cc.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/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