title: how to run svn update via svn post-commit hook
body: <p>Goal: update  <code>/var/www</code>  with latest on svn commit. </p>
  
  <p>ubuntu server 10.10, latest apache2, latest svn, location: <code>/var/svn/[projectname]</code></p>
  
  <p>To do this I created a simple post-commit script:</p>
  
  <pre><code>#!/bin/bash
  
  #tests if www-data user runs this script on commit (which it does)
  touch /tmp/test.log
  
  #works when run from the command line (sudo ./post-commit) but not when run by www-data
  sudo /usr/bin/svn update /var/www
  </code></pre>
  
  <p>To fix the issue of the second command not working as www-data I tried...</p>
  
  <p>Editing: <code>sudo visudo</code> and added (at the end): <code>www-data ALL=(ALL) NOPASSWD:ALL</code></p>
  
  <p>Chowning: <code>/var/www</code> to <code>www-data:www-data</code></p>
  
  <p>Chmoding: all of <code>/var/www</code> to 777</p>
  
  <p>Still no luck... any ideas?</p>