title: Elastic Beanstalk: what's the best way to create folders & set permissions after deploy?
body: <p>I'm running a Rails 4.2 app on Elastic Beanstalk, and need to set log permissions and create the /tmp/uploads folder (plus permissions) after deploy.</p>
  
  <p>I was running two ebextensions scripts to do this, but on some occasions they would fail because the folder /var/app/current/ didn't yet exist.</p>
  
  <p>I'm presuming this is because the permissions and/or folders should be created on /app/ondeck/ first so that EB can copy the contents over to /var/app/current/, but I'm interested to see if there's a recommended and more foolproof approach to doing this?</p>
  
  <p>For reference, my two ebextension scripts were:</p>
  
  <pre><code>commands: 
      01_set_log_permissions:
          command: "chmod 755 /var/app/current/log/*"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>commands: 
      01_create_uploads_folder: 
          command: "mkdir -p /var/app/current/tmp/uploads/"
      02_set_folder_permission: 
          command: "chmod 755 /var/app/current/tmp/uploads/"
  </code></pre>
  
  <p>Thanks,
  Dan</p>